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

Home » Public Forums » archive » Re: star symbol in labels??
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
Re: star symbol in labels?? [message #81461] Fri, 21 September 2012 01:35 Go to next message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le vendredi 21 septembre 2012 03:56:06 UTC+2, bing999 a écrit :
> Thanks Mats for the clarification regarding textoidl. However, in the
>
> case of a star symbol, I don't know the IDL string, and nor does
>
> google... :)
>
> From David's post, I guess that's a well-known issue.
>
>
>
> Any other way to put a star symbol in a string?
>
> Thanks guys!
>
> Bing

The 'dejavusans' font, introduced in IDL 8.2, includes the star symbol (unicode '22C6'x).
For instance:

pl=plot(/TEST) & !null=text(0.5,0.5,'$\U(22C6)$',FONT_SIZE=30)

alx.
Re: star symbol in labels?? [message #81463 is a reply to message #81461] Thu, 20 September 2012 19:18 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
bing999 writes:

> Thanks Mats for the clarification regarding textoidl. However, in the
> case of a star symbol, I don't know the IDL string, and nor does
> google... :)
> From David's post, I guess that's a well-known issue.

I think it's easy enough to discover the Unicode value for
stars on Google. The hard part is finding a font that supports
those Unicode values. I don't believe any of the ones delivered
with IDL do.

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.")
Re: star symbol in labels?? [message #81464 is a reply to message #81463] Thu, 20 September 2012 18:56 Go to previous messageGo to next message
Thibault Garel is currently offline  Thibault Garel
Messages: 55
Registered: October 2009
Member
Thanks Mats for the clarification regarding textoidl. However, in the
case of a star symbol, I don't know the IDL string, and nor does
google... :)
From David's post, I guess that's a well-known issue.

Any other way to put a star symbol in a string?
Thanks guys!
Bing
Re: star symbol in labels?? [message #81468 is a reply to message #81464] Thu, 20 September 2012 10:36 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mats Löfdahl writes:

> It's fairly easy to add new symbols - PROVIDED YOU KNOW THE
> PROPER IDL STRINGS.

Ah, there's the rub! ;-)

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.")
Re: star symbol in labels?? [message #81470 is a reply to message #81468] Thu, 20 September 2012 10:17 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den torsdagen den 20:e september 2012 kl. 03:09:07 UTC+2 skrev bing999:
> Hi,
>
>
>
> I'd like to plot a star symbol in labels, i.e. xtitle=...
>
> Do you know how to do that please?
>
>
>
> Textoidl sounded to be a straightforward way to do that.
>
> However, it seems that it does not support \star.
>
>
>
> plot,dindgen(3),xtitle=textoidl('\star') will print \star instead of
>
> the symbol.
>
> However, if one plots an asterisk with \ast, it works fine...
>
>
>
> I am a bit confused... Does textoidl miss some tex libraries?

Textoidl does not actually invoke TeX. It just knows how to translate a small subset of TeX to IDL strings. And it knows to do it differently depending on whether you are using vector fonts or postscript fonts.

It's fairly easy to add new symbols - provided you know the proper IDL strings. You just edit one of the tables in textable.pro, which can be found in the textoidl directory.
Re: star symbol in labels?? [message #90377 is a reply to message #81461] Thu, 26 February 2015 21:00 Go to previous messageGo to next message
toby.brown03 is currently offline  toby.brown03
Messages: 2
Registered: February 2015
Junior Member
On Friday, September 21, 2012 at 6:35:06 PM UTC+10, alx wrote:
> Le vendredi 21 septembre 2012 03:56:06 UTC+2, bing999 a écrit :
>> Thanks Mats for the clarification regarding textoidl. However, in the
>>
>> case of a star symbol, I don't know the IDL string, and nor does
>>
>> google... :)
>>
>> From David's post, I guess that's a well-known issue.
>>
>>
>>
>> Any other way to put a star symbol in a string?
>>
>> Thanks guys!
>>
>> Bing
>
> The 'dejavusans' font, introduced in IDL 8.2, includes the star symbol (unicode '22C6'x).
> For instance:
>
> pl=plot(/TEST) & !null=text(0.5,0.5,'$\U(22C6)$',FONT_SIZE=30)
>
> alx.

Hello, has there been any advancement on this issue?

I would really like to have a subscript star on my labels (i.e M_{\star}) however I can't find a routine for the job.

Any ideas?

Toby
Re: star symbol in labels?? [message #90383 is a reply to message #90377] Fri, 27 February 2015 10:53 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Thursday, February 26, 2015 at 10:00:33 PM UTC-7, toby.b...@gmail.com wrote:
> On Friday, September 21, 2012 at 6:35:06 PM UTC+10, alx wrote:
>> Le vendredi 21 septembre 2012 03:56:06 UTC+2, bing999 a écrit :
>>> Thanks Mats for the clarification regarding textoidl. However, in the
>>>
>>> case of a star symbol, I don't know the IDL string, and nor does
>>>
>>> google... :)
>>>
>>> From David's post, I guess that's a well-known issue.
>>>
>>>
>>>
>>> Any other way to put a star symbol in a string?
>>>
>>> Thanks guys!
>>>
>>> Bing
>>
>> The 'dejavusans' font, introduced in IDL 8.2, includes the star symbol (unicode '22C6'x).
>> For instance:
>>
>> pl=plot(/TEST) & !null=text(0.5,0.5,'$\U(22C6)$',FONT_SIZE=30)
>>
>> alx.
>
> Hello, has there been any advancement on this issue?
>
> I would really like to have a subscript star on my labels (i.e M_{\star}) however I can't find a routine for the job.
>
> Any ideas?
>
> Toby

It's easy to do with new graphics:

x = findgen(100)
y = randomu(seed,100)
p = plot(x,y,TITLE='$M_{\U(22C6)}$', FONT_SIZE=30)

Cheers,
Chris
Re: star symbol in labels?? [message #90388 is a reply to message #90383] Fri, 27 February 2015 11:46 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Chris Torrence writes:

> It's easy to do with new graphics:
>
> x = findgen(100)
> y = randomu(seed,100)
> p = plot(x,y,TITLE='$M_{\U(22C6)}$', FONT_SIZE=30)

It's pretty easy with Coyote Graphics, too, if you are using IDL 8.2 or
higher. First, make sure DejaVuSans is your true-type font. I usually do
this in my IDL start-up file.

cgSet_TTFont, 'Dejavusans'

Then, to make the plot:

cgPlot, x,y,TITLE='M!D!Z(22C6)!N', Font=1, Output='test.png'

Cheers,

David
--
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.")
Re: star symbol in labels?? [message #90409 is a reply to message #90388] Sun, 01 March 2015 15:22 Go to previous message
toby.brown03 is currently offline  toby.brown03
Messages: 2
Registered: February 2015
Junior Member
On Saturday, February 28, 2015 at 6:46:27 AM UTC+11, David Fanning wrote:
> Chris Torrence writes:
>
>> It's easy to do with new graphics:
>>
>> x = findgen(100)
>> y = randomu(seed,100)
>> p = plot(x,y,TITLE='$M_{\U(22C6)}$', FONT_SIZE=30)
>
> It's pretty easy with Coyote Graphics, too, if you are using IDL 8.2 or
> higher. First, make sure DejaVuSans is your true-type font. I usually do
> this in my IDL start-up file.
>
> cgSet_TTFont, 'Dejavusans'
>
> Then, to make the plot:
>
> cgPlot, x,y,TITLE='M!D!Z(22C6)!N', Font=1, Output='test.png'
>
> Cheers,
>
> David
> --
> 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.")

Excellent, thank you guys.

Toby
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Debuging
Next Topic: Is it possible to save the figure file in .PNG format directly in IDL?

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

Current Time: Wed Oct 08 13:32:22 PDT 2025

Total time taken to generate the page: 0.00675 seconds