| Re: Greek and other Symbols in Coyote Graphics [message #81088 is a reply to message #80966] |
Wed, 08 August 2012 03:46  |
ameigs
Messages: 12 Registered: March 2009
|
Junior Member |
|
|
On Saturday, July 28, 2012 12:12:38 AM UTC+1, David Fanning wrote:
> 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.")
Excellent David. Now how about subscripts and superscripts? Or is that already taken care of?
Andy
|
|
|
|