comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » cgsymbols change when saving from cgwindow to pdf
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
cgsymbols change when saving from cgwindow to pdf [message #91493] Mon, 20 July 2015 20:20 Go to next message
A J is currently offline  A J
Messages: 11
Registered: February 2012
Junior Member
Hello all,

When I open a plot using cgwindow and display text using cgsymbol on that plot, and then save to a pdf using the cgwindow drop down menu, some of the symbols change.

For example, cgsymbol('sigma') gives the correct sigma symbol on the pop-up cgwindow, but converts to an 'r' in the saved pdf. cgsymbol('sigma', /ps) gives the wrong symbol in the pop-up window, but the correct symbol in the pdf. I need the symbol to be correct on both as I am using both and cannot have a difference in readability.

Any solutions?(Using a mac, if it matters).

Small illustrative example:

cgwindow, 'cgplot', indgen(100), /xstyle
cgwindow, 'cgtext', 20, 70, cgSymbol('sigma'), /data, /addcmd

-->save to pdf, sigma becomes an 'r'.

cgwindow, 'cgplot', indgen(100), /xstyle
cgwindow, 'cgtext', 20, 70, cgSymbol('sigma', /ps), /data, /addcmd


--> displays a lower-case sigma in 'word-final position' instead of the standard lower-case sigma on the cgwindow, and in the pdf it is displayed as the intended sigma symbol.

Thanks,

AJ
Re: cgsymbols change when saving from cgwindow to pdf [message #91543 is a reply to message #91493] Sun, 26 July 2015 12:54 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
ajillig@gmail.com writes:

>
> Hello all,
>
> When I open a plot using cgwindow and display text using cgsymbol on that plot, and then save to a pdf using the cgwindow drop down menu, some of the symbols change.
>
> For example, cgsymbol('sigma') gives the correct sigma symbol on the pop-up cgwindow, but converts to an 'r' in the saved pdf. cgsymbol('sigma', /ps) gives the wrong symbol in the pop-up window, but the correct symbol in the pdf. I need the symbol to be correct on both as I am using both and cannot have a difference in readability.
>
> Any solutions?(Using a mac, if it matters).
>
> Small illustrative example:
>
> cgwindow, 'cgplot', indgen(100), /xstyle
> cgwindow, 'cgtext', 20, 70, cgSymbol('sigma'), /data, /addcmd
>
> -->save to pdf, sigma becomes an 'r'.
>
> cgwindow, 'cgplot', indgen(100), /xstyle
> cgwindow, 'cgtext', 20, 70, cgSymbol('sigma', /ps), /data, /addcmd
>
>
> --> displays a lower-case sigma in 'word-final position' instead of the standard lower-case sigma on the cgwindow, and in the pdf it is displayed as the intended sigma symbol.

This is a limitation of the way Coyote Graphics has to work to
"recreate" the command when things are redrawn. You can't actually call
a function from within the command you are trying to "recreate", since
there is no actual command stack.

To get what you want, you can write a routine like this:

pro main
cgplot, indgen(100), /xstyle
cgtext, 20, 70, cgSymbol('sigma'), /data
end

And call it like this:

IDL> cgWindow, 'main'

Cheers,

David

IDL> .r


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: HELP adding arrays
Next Topic: Question - window.hittest method

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:20:42 PDT 2025

Total time taken to generate the page: 0.00397 seconds