Turn off TeX for legend labels

View: New views
17 Messages — Rating Filter:   Alert me  

Turn off TeX for legend labels

by andy buckle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have been able to set 'interpreter' to 'none' for titles and axes labels, but I can't seem to get it to work for legends. I would be grateful for advice. (I tried this on 3.0.1)

Re: Turn off TeX for legend labels

by Ivan Sutoris :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Apr 14, 2009 at 7:27 PM, andy buckle <andybuckle@...> wrote:

>
> I have been able to set 'interpreter' to 'none' for titles and axes labels,
> but I can't seem to get it to work for legends. I would be grateful for
> advice. (I tried this on 3.0.1)
> --
> View this message in context: http://www.nabble.com/Turn-off-TeX-for-legend-labels-tp23044064p23044064.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> Help-octave@...
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>


I think legend is not yet implemented fully in Matlab-compatible way.
I've been able to disable tex rendering in legend by setting
"interpreter" property of corresponding line object:

lh = plot(1:5) % returns handle to line object
legend('\xi')
set(lh, 'interpreter', 'none')

Regards
Ivan Sutoris
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: Turn off TeX for legend labels

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Apr 14, 2009, at 1:27 PM, andy buckle wrote:

>
> I have been able to set 'interpreter' to 'none' for titles and axes  
> labels,
> but I can't seem to get it to work for legends. I would be grateful  
> for
> advice. (I tried this on 3.0.1)

I haven't tried this on 3.0.1, but it works on 3.0.4

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
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: Turn off TeX for legend labels

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Apr 14, 2009, at 7:57 PM, Ben Abbott wrote:

>
> On Apr 14, 2009, at 1:27 PM, andy buckle wrote:
>
>>
>> I have been able to set 'interpreter' to 'none' for titles and axes
>> labels,
>> but I can't seem to get it to work for legends. I would be grateful
>> for
>> advice. (I tried this on 3.0.1)
>
> I haven't tried this on 3.0.1, but it works on 3.0.4
>
> 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
I've attached a changeset for the developers sources. If there are no  
objections, I'll push it tomorrow.

Ben







_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

changeset-legend.patch (2K) Download Attachment

Re: Turn off TeX for legend labels

by andy buckle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ivan Sutoris wrote:
lh = plot(1:5) % returns handle to line object
legend('\xi')
set(lh, 'interpreter', 'none')

Regards
Ivan Sutoris
plot(X, Y, 'b','interpreter','none')

Similar to Ivan's advice, this is stopping rendering of Greek, but I am still getting subscripts from underscores.

Re: Turn off TeX for legend labels

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Apr 15, 2009, at 4:07 AM, andy buckle wrote:

> Ivan Sutoris wrote:
>>
>> lh = plot(1:5) % returns handle to line object
>> legend('\xi')
>> set(lh, 'interpreter', 'none')
>>
>> Regards
>> Ivan Sutoris
>>
>
> plot(X, Y, 'b','interpreter','none')
>
> Similar to Ivan's advice, this is stopping rendering of Greek, but I  
> am
> still getting subscripts from underscores.

hmmm ... my understanding was that the properties set via the plot  
command applied to the line objects created. Line objects do not have  
a "interpreter" property. Your example gives an error in Matlab, but  
does not in Octave.

I'd assume Octave should give an error, but does not.

Perhaps I'm confused. What objects do you expect this to impact?

Ben


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: Turn off TeX for legend labels

by andy buckle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 settings 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.

perhaps there is alternative workaround. Is there something like the HTML <pre> in TeX?

Parent Message unknown Re: Turn off TeX for legend labels

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday, April 15, 2009, at 08:01AM, "andy buckle" <andybuckle@...> 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 settings
>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
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: Turn off TeX for legend labels

by andy buckle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Apr 15, 2009 at 2:41 PM, Ben Abbott <bpabbott@...> wrote:

> On Wednesday, April 15, 2009, at 08:01AM, "andy buckle" <andybuckle@...> 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 settings
>>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)

this

set (findobj (gca, "-property", "keylabel"), "interpreter",   "none")

stopped rendering Greek, but underscores still yield subscripted characters.

HTML <pre> means pre-formatted. Is there a way in TeX to stop TeX
interpretation of part of a string?
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: Turn off TeX for legend labels

by Ivan Sutoris :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Apr 15, 2009 at 3:41 PM, Ben Abbott <bpabbott@...> wrote:
>
> 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")

> 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")

Shouldn't the two codes above do the same thing in principle? The
problem seems to be that while this is the correct way to disable tex
rendering for legend entries in Octave, as Andy wrote in fact
subscripts are still rendered (I can confirm that with development
version), which is probably a bug.

Regards
Ivan Sutoris
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: Turn off TeX for legend labels

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Wednesday, April 15, 2009, at 10:05AM, "Andy Buckle" <andybuckle@...> wrote:

>On Wed, Apr 15, 2009 at 2:41 PM, Ben Abbott <bpabbott@...> wrote:
>> On Wednesday, April 15, 2009, at 08:01AM, "andy buckle" <andybuckle@...> 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 settings
>>>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)
>
>this
>
>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?

Ben
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Parent Message unknown Re: Turn off TeX for legend labels

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday, April 15, 2009, at 10:07AM, "Ivan Sutoris" <ivan.sutoris@...> wrote:

>On Wed, Apr 15, 2009 at 3:41 PM, Ben Abbott <bpabbott@...> wrote:
>>
>> 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")
>
>> 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")
>
>Shouldn't the two codes above do the same thing in principle? The
>problem seems to be that while this is the correct way to disable tex
>rendering for legend entries in Octave, as Andy wrote in fact
>subscripts are still rendered (I can confirm that with development
>version), which is probably a bug.
>
>Regards
>Ivan Sutoris

Agreed. I'd missed that Andy was speaking specifically of the underscore.

I did a quick check, it appears the underscore problem exists for text objects as well. Do you see the same behavior?

If I leave the TeX interpreter on, then this works for me

plot (x, sin(x), x, cos(x))
legend ("test\\_1", "test\\_2")

Ben

p.s. Andy, I just indicated that this didn't work, but I was in error.


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: Turn off TeX for legend labels

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday, April 15, 2009, at 10:38AM, "Ben Abbott" <bpabbott@...> wrote:

>
>
>On Wednesday, April 15, 2009, at 10:05AM, "Andy Buckle" <andybuckle@...> wrote:
>>On Wed, Apr 15, 2009 at 2:41 PM, Ben Abbott <bpabbott@...> wrote:
>>> On Wednesday, April 15, 2009, at 08:01AM, "andy buckle" <andybuckle@...> 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 settings
>>>>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)
>>
>>this
>>
>>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?
>
>Ben

ok, my bad. The syntax below works

plot (x, sin(x), x, cos(x))
legend ("test\\_1", "test\\_2")

Ben

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: Turn off TeX for legend labels

by andy buckle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Apr 15, 2009 at 3:45 PM, Ben Abbott <bpabbott@...> wrote:

> On Wednesday, April 15, 2009, at 10:38AM, "Ben Abbott" <bpabbott@...> wrote:
>>
>>
>>On Wednesday, April 15, 2009, at 10:05AM, "Andy Buckle" <andybuckle@...> wrote:
>>>On Wed, Apr 15, 2009 at 2:41 PM, Ben Abbott <bpabbott@...> wrote:
>>>> On Wednesday, April 15, 2009, at 08:01AM, "andy buckle" <andybuckle@...> 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 settings
>>>>>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)
>>>
>>>this
>>>
>>>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?
>>
>>Ben
>
> 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
 title("\\_foo")
 title('\_foo')
 legend("\\_foo")
 legend('\_foo')

These do not
title('\\_foo')
legend('\\_foo')

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.

Thanks!

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.

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: Turn off TeX for legend labels

by John W. Eaton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 15-Apr-2009, Andy Buckle wrote:

| These successfully escape the underscore
|  title("\\_foo")
|  title('\_foo')
|  legend("\\_foo")
|  legend('\_foo')
|
| These do not
| title('\\_foo')
| legend('\\_foo')

Yes, I think that makes sense given the quoting rules of " vs '
delimeted character strings.

| To summarise
| Bug1: 'interpreter' set to 'none' does not prevent underscores subscripting

This seems to work properly for me in the current development sources,
at least with title objects:

  title ("foo_bar", "interpreter", "none");

| 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.

To be compatible with Matlab, the legend needs to be constructed as a
separate subplot instead of using the "key" feature of gnuplot.

jwe
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: Turn off TeX for legend labels

by John W. Eaton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 14-Apr-2009, Ben Abbott wrote:

| On Apr 14, 2009, at 7:57 PM, Ben Abbott wrote:
|
| >
| > On Apr 14, 2009, at 1:27 PM, andy buckle wrote:
| >
| >>
| >> I have been able to set 'interpreter' to 'none' for titles and axes
| >> labels,
| >> but I can't seem to get it to work for legends. I would be grateful
| >> for
| >> advice. (I tried this on 3.0.1)
| >
| > I haven't tried this on 3.0.1, but it works on 3.0.4
| >
| > 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
|
| I've attached a changeset for the developers sources. If there are no  
| objections, I'll push it tomorrow.

I think it would be much better to implement a Matlab-compatible
legend function.  I think doing that is possible now.  The legend
shouuld create an additional axes object that includes three objects
for each entry in the legend.  The first is for the marker associated
with the legend item, the second is for the line, and the third is the
label.  I think placement and sizing will require some effort.  It
would also be nice if the legend object could be opaque so it may
appear on top of other plot objects, but I don't think that is
absolutely necessary.

jwe
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Parent Message unknown Re: Turn off TeX for legend labels

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Monday, April 20, 2009, at 02:41PM, "John W. Eaton" <jwe@...> wrote:

>On 14-Apr-2009, Ben Abbott wrote:
>
>| On Apr 14, 2009, at 7:57 PM, Ben Abbott wrote:
>| >
>| > On Apr 14, 2009, at 1:27 PM, andy buckle wrote:
>| >>
>| >> I have been able to set 'interpreter' to 'none' for titles and axes
>| >> labels,
>| >> but I can't seem to get it to work for legends. I would be grateful
>| >> for
>| >> advice. (I tried this on 3.0.1)
>| >
>| > I haven't tried this on 3.0.1, but it works on 3.0.4
>| >
>| > 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
>|
>| I've attached a changeset for the developers sources. If there are no  
>| objections, I'll push it tomorrow.
>
>I think it would be much better to implement a Matlab-compatible
>legend function.  I think doing that is possible now.  The legend
>shouuld create an additional axes object that includes three objects
>for each entry in the legend.  The first is for the marker associated
>with the legend item, the second is for the line, and the third is the
>label.  I think placement and sizing will require some effort.  It
>would also be nice if the legend object could be opaque so it may
>appear on top of other plot objects, but I don't think that is
>absolutely necessary.
>
>jwe
>

I agree.

For the next 1-2 months I don't have the time to take this on.

If anyone is inclinded to tackle this, please do.

Ben



_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave