[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Turn off TeX for legend labels

From: Andy Buckle
Subject: Re: Turn off TeX for legend labels
Date: Wed, 15 Apr 2009 15:56:50 +0100

On Wed, Apr 15, 2009 at 3:45 PM, Ben Abbott <address@hidden> wrote:
> On Wednesday, April 15, 2009, at 10:38AM, "Ben Abbott" <address@hidden> wrote:
>>On Wednesday, April 15, 2009, at 10:05AM, "Andy Buckle" <address@hidden> 
>>>On Wed, Apr 15, 2009 at 2:41 PM, Ben Abbott <address@hidden> wrote:
>>>> On Wednesday, April 15, 2009, at 08:01AM, "andy buckle" <address@hidden> 
>>>> wrote:
>>>>>Ben Abbott wrote:
>>>>>> Perhaps I'm confused. What objects do you expect this to impact?
>>>>>I am just trying stuff, to try and make it work.
>>>>>Let's say we have a plot with 3 curves on. you might want different 
>>>>>for the legend labels for each curve. Indeed
>>>>>octave> get(get(gca,"children")(1))
>>>>>shows you that the 'keylabel' and 'interpreter' for the legend are accessed
>>>>>via the plot handle.
>>>> You've infered incorrectly. The plot handle is for the line objects, not 
>>>> the axes. The two examples below should be equivalent.
>>>> h = plot (0:10);
>>>> set (h, "interpreter", "none")
>>>> plot (0:10, "interpreter", "none")
>>>>>perhaps there is alternative workaround. Is there something like the HTML
>>>>><pre> in TeX?
>>>> I'm unfamiliar with HTML.
>>>> Regarding a workaround, did you catch the one I posted yesterday?
>>>>> octave:1> x = 0:0.1:5;
>>>>> octave:2> plot(x,sin(x),x,cos(x))
>>>>> octave:3> legend ("\\alpha", "\\beta")
>>>>> octave:4> set (findobj (gca, "-property", "keylabel"), "interpreter", 
>>>>> "none")
>>>> Ben
>>>That's a bug then (3.0.1)
>>>octave> x=0:.2:6; y1 = sin(x); y2 = cos(x);
>>>octave> plot(x,y1,x,y2)
>>>octave> legend("sin(x)", "cos(x)")
>>>octave> get(get(gca,"children")(1),"keylabel")
>>>ans = sin(x)
>>>octave> get(get(gca,"children")(2),"keylabel")
>>>ans = cos(x)
>>>set (findobj (gca, "-property", "keylabel"), "interpreter",   "none")
>>>stopped rendering Greek, but underscores still yield subscripted characters.
>>ahhhh, ok!
>>I see your point. That is a bug, and it exists in the developers sources as 
>>well. In fact, I see the same behavior for text objects.
>>>HTML <pre> means pre-formatted. Is there a way in TeX to stop TeX
>>>interpretation of part of a string?
>>In TeX, I'd use "\_". This does work for text objects, but it isn't working 
>>for me for the legend labels.
>>Can you confirm the same behavior?
> ok, my bad. The syntax below works
> plot (x, sin(x), x, cos(x))
> legend ("test\\_1", "test\\_2")
> Ben

These successfully escape the underscore

These do not

To summarise
Bug1: 'interpreter' set to 'none' does not prevent underscores subscripting
Bug2: some properties of the legend key label text are accessible via
the plot handles.
Feature request: make legend key label text properties available somehow.


I would have a go at generating some patches for this, but I only have
3.0.1 at work and my current development source version is languishing
on a dysfunctional linux machine at home.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]