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

Home » Public Forums » archive » Re: Greek Symbols in Plot Annotations
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Greek Symbols in Plot Annotations [message #69283 is a reply to message #69282] Mon, 11 January 2010 15:02 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Excellent. I no longer need to do stuff like

Delta = !D.NAME EQ 'PS' ? '!9D!X' : '!4D!X'
epsilon = !D.NAME EQ 'PS' ? '!9e!X' : '!4e!X'

in my code! Woohoo!

BTW, why not do something like

IF !D.NAME EQ 'PS' THEN BEGIN
DEVICE, /ISOLATIN1
esc = '!9'
ENDIF ELSE BEGIN
esc = '!4'
ENDELSE

CASE StrLowCase(letter) OF
'alpha': greekLetter = (capital) ? String("101B) : String("141B)
'beta': greekLetter = (capital) ? String("102B) : String("142B)
...etc...
ENDCASE
greekLetter = esc + greekLetter + '!X'

?

The only thing the CASE construct should be doing is selecting the right string element,
right? All the other stuff (prefixing and suffixing with the escape sequences, testing for
PS or not) can be done outside. Then you only need one CASE construct and the code is not
so wet[*]. :o)

cheers,

paulv


[*] http://en.wikipedia.org/wiki/Don't_repeat_yourself


David Fanning wrote:
> wlandsman writes:
>
>> Those of us who know LateX have probably been using the TeXtoIDL
>> package for this task. (The original version is at
>> http://physweb.mnstate.edu/mcraig/textoidl/ ; a slightly improved
>> package is available in the excellent Sloan Digital Sky Survey (SDSS)
>> library http://code.google.com/p/sdssidl/ ). One finds the string
>> for the Greek alpha symbol as string = textoidl('\alpha'). But I
>> don't believe that TeXtoIDL handles true-type fonts, so greek.pro
>> should still be useful even for TeXtoIDL users -- thanks.
>
> Maarten Sneep gave me a great suggestion this morning. As
> an alternative to setting the CAPITAL keyword to getting
> the uppercase Greek letter, you can now also capitalize
> the first letter of the Greek name. So, before to get
> a capital letter you did this:
>
> Print, Greek('omega', /CAPITAL)
>
> But now you can also do this:
>
> Print, Greek('Omega')
>
> The program is here:
>
> http://www.dfanning.com/programs/greek.pro
>
> Cheers,
>
> David
>
>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Removing if then else loop for efficiency
Next Topic: Re: pointer & structure

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

Current Time: Fri Oct 10 18:03:26 PDT 2025

Total time taken to generate the page: 1.19780 seconds