« Return to Thread: how to avoid '_' interpretation in plot legend ?

Re: how to avoid '_' interpretation in plot legend ?

by Ben Abbott :: Rate this Message:

Reply to Author | View in Thread


On Monday, July 06, 2009, at 08:59AM, "Sergei Steshenko" <sergstesh@...> wrote:

>
>Hello,
>
>if I enter, say, the following command:
>
>plot(1:10, 1:10, "-;foo_bar;1");
>
>, I'm getting straight red line plotted (and this is expected), but the
>legend says
>
>foobar
>
>with 'b' being below the rest of characters and having smaller size -
>instead of the expected
>
>foo_bar.
>
>
>I think I should use some kind of 'set' command, but "help set" does not
>provide particular info.
>
>
>I know that for titles I should use
>
>set(title("foo_bar"), "Interpreter", "none");
>
>, but I do not know what to use for legends.
>
>Thanks,
>  Sergei.

Looks like a bug to me. I can't presently run the developers sources, but I see the same effect in 3.2.

The proper fix would be to properly implement the legend as a separate axes object, and have the text labels inherit their parent's interpreter property.

Until then it would be possible to (1) change the legend interpreter to "none", or (2) have the legend inherit the interpreter of its axes.

For a quick fix, and if you don't mind the console error it produces, you can try the change below

    plot(1:10, 1:10, "-;foo{_}bar;1");

Ben

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

 « Return to Thread: how to avoid '_' interpretation in plot legend ?