cgsymbols change when saving from cgwindow to pdf [message #91493] |
Mon, 20 July 2015 20:20  |
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  |
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.")
|
|
|