Re: Greek and other Symbols in Coyote Graphics [message #80966] |
Fri, 27 July 2012 16:12  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> This morning it occurred to me that I can use the same
> "escape sequences" used by Function Graphics to specify
> symbols in my Coyote Graphics routines. These escape
> sequences prepend a "$\" to the symbol you want to
> call with cgSymbol, and append a closing "$".
>
> So, here is the clunky way a cgPlot command would have to be
> constructed currently to display properly in a cgWindow
> and in an output file with a mu and angstrom symbol:
>
> cgPlot, cgDemoData(1), /Window, $
> XTitle='Length (' + cgSymbol('mu') + M)', $
> YTitle='Distance (' + cgSymbol('Angstrom') + ')', $
> ALT_KEYWORDS={xtitle:'Length (' + cgSymbol('mu', /PS) + M)', $
> ytitle:'Distance ('+ cgSymbol('Angstrom', /PS)+')'}
>
> And here is the new way to do this:
>
> cgPlot, cgDemoData(1), /Window, $
> XTitle='Length ($\mu$M)', $
> YTitle='Distance ($\Angstrom$)'
>
> Quite a bit simpler, yes? :-)
I have now updated all the graphics routines in the Coyote
Library to take advantage of this method of specifying
Greek characters and other symbols.
Update your SVN code repository, or download the latest
version of the library from the code repository page:
http://idl-coyote.googlecode.com/
Or, from here:
http://www.idlcoyote.com/programs/zip_files/coyoteprograms.z ip
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|