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

Home » Public Forums » archive » Escape "/" for NG LEGEND
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
Escape "/" for NG LEGEND [message #87552] Fri, 14 February 2014 12:25 Go to next message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Hi,
I just created a plot with a legend in new graphics (NG). LEGEND function requires that the NAME keyword is assigned to each plot command. My names include units so include the "/" character. However, IDL 8.3 returns "The identifier property value cannot contain '/' characters." Does anybody know if there is a way to escape this?

Thanks,
Haje
Re: Escape "/" for NG LEGEND [message #87553 is a reply to message #87552] Fri, 14 February 2014 12:28 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Haje Korth writes:

> I just created a plot with a legend in new graphics (NG). LEGEND function requires that the NAME keyword is assigned to each plot command. My names include units so include the "/" character. However, IDL 8.3 returns "The identifier property value cannot contain '/' characters." Does anybody know if there is a way to escape this?

This was discussed recently here. Can't remember how it was resolved,
but Chris Torrance responded with some kind of workaround.

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: Escape "/" for NG LEGEND [message #87554 is a reply to message #87553] Fri, 14 February 2014 12:31 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> This was discussed recently here. Can't remember how it was resolved,
> but Chris Torrance responded with some kind of workaround.

Here is Chris's response:

Yes, unfortunately, this happens because the "/" is used to separate the
different object graphics pieces, just like a directory separator.

But the easiest solution is to just use the "LaTeX" / character instead,
like this:

p = plot(x, y, name='2008 $\slash$ 2009')
l = legend()

Notice that I put an extra space before and after the slash character.
At least on my Mac, if you don't have the space, it doesn't leave enough
room around the slash. Maybe because it is a Unicode "math" character.
Also, I used single quotes so it doesn't think the 2008 is some sort of
weird octal number.

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: Escape "/" for NG LEGEND [message #87555 is a reply to message #87554] Fri, 14 February 2014 12:40 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Thank you so much for the quick solution. I could not find the post you referred to, so I am glad you found this. Haje

On Friday, February 14, 2014 3:31:04 PM UTC-5, David Fanning wrote:
> David Fanning writes:
>
>
>
>> This was discussed recently here. Can't remember how it was resolved,
>
>> but Chris Torrance responded with some kind of workaround.
>
>
>
> Here is Chris's response:
>
>
>
> Yes, unfortunately, this happens because the "/" is used to separate the
>
> different object graphics pieces, just like a directory separator.
>
>
>
> But the easiest solution is to just use the "LaTeX" / character instead,
>
> like this:
>
>
>
> p = plot(x, y, name='2008 $\slash$ 2009')
>
> l = legend()
>
>
>
> Notice that I put an extra space before and after the slash character.
>
> At least on my Mac, if you don't have the space, it doesn't leave enough
>
> room around the slash. Maybe because it is a Unicode "math" character.
>
> Also, I used single quotes so it doesn't think the 2008 is some sort of
>
> weird octal number.
>
>
>
> 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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Postgresql and PV-Wave on Linux
Next Topic: Reconstruct surface from gradient field?

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

Current Time: Wed Oct 08 11:41:12 PDT 2025

Total time taken to generate the page: 0.00621 seconds