Escape "/" for NG LEGEND [message #87552] |
Fri, 14 February 2014 12:25  |
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 #87554 is a reply to message #87553] |
Fri, 14 February 2014 12:31   |
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  |
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.")
|
|
|