|
View:
New views
10 Messages
—
Rating Filter:
Alert me
|
|
|
how to avoid '_' interpretation in plot legend ?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. _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
|
|
|
|
|
|
|
|
|
Re: how to avoid '_' interpretation in plot legend ?On Monday, July 06, 2009, at 10:44AM, "Sergei Steshenko" <sergstesh@...> wrote:
> > > >--- On Mon, 7/6/09, Ben Abbott <bpabbott@...> wrote: > >> From: Ben Abbott <bpabbott@...> >> Subject: Re: how to avoid '_' interpretation in plot legend ? >> To: "Sergei Steshenko" <sergstesh@...> >> Cc: help-octave@... >> Date: Monday, July 6, 2009, 7:40 AM >> >> 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 >> >> > >How to change legend interpreter to none ? I.e. what is the exact command ? > >Thanks, > Sergei. The legend does not presently have an interpreter property. The rendering of the legend appears to use be presently using the TeX interpreter. To change the behavior __go_draw_axes__.m would need to be patched to modify how gnuplot's keylabel is handled. Ben _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: how to avoid '_' interpretation in plot legend ?On Monday, July 06, 2009, at 10:48AM, "Sergei Steshenko" <sergstesh@...> wrote: > >--- On Mon, 7/6/09, Ben Abbott <bpabbott@...> wrote: > >> From: Ben Abbott <bpabbott@...> >> Subject: Re: how to avoid '_' interpretation in plot legend ? >> To: "Sergei Steshenko" <sergstesh@...> >> Cc: help-octave@... >> Date: Monday, July 6, 2009, 7:40 AM >> >> 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 >> >> > > >Ben, > >plot(1:10, 1:10, "-;foo{_}bar;1"); > >doesn't work, i.e. it produces (octave-3.0.3) > >foobar > >instead of the expected > >foo_bar >. > >Thanks, > Sergei. You are correct. I missed the "missing" underscore. Perhaps someone else can provide a solution? Ben _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
RE: how to avoid '_' interpretation in plot legend ?|-----Original Message-----
|From: Ben Abbott [mailto:bpabbott@...] |Sent: Monday, July 06, 2009 10:51 AM | |On Monday, July 06, 2009, at 10:44AM, "Sergei Steshenko" |<sergstesh@...> wrote: |> |> |> |>--- On Mon, 7/6/09, Ben Abbott <bpabbott@...> wrote: |> |>> From: Ben Abbott <bpabbott@...> |>> Subject: Re: how to avoid '_' interpretation in plot legend ? |>> To: "Sergei Steshenko" <sergstesh@...> |>> Cc: help-octave@... |>> Date: Monday, July 6, 2009, 7:40 AM |>> |>> 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 |>> > |> |>How to change legend interpreter to none ? I.e. what is the |exact command ? |> |>Thanks, |> Sergei. | |The legend does not presently have an interpreter property. |The rendering of the legend appears to use be presently using |the TeX interpreter. To change the behavior __go_draw_axes__.m |would need to be patched to modify how gnuplot's keylabel is handled. | |Ben | Does strrep( mylegstr, "_", "\_" ) work or plot(1:10, 1:10, "-;foo\_bar;1"); ? I don't have an up-to-date copy of Octave to try, but its what I normally use in the other brand. _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: how to avoid '_' interpretation in plot legend ?2009/7/6 Ben Abbott <bpabbott@...>:
> You are correct. I missed the "missing" underscore. > > Perhaps someone else can provide a solution? > the following workaround seems to work in 3.2.0: octave-3.2.0:20> plot(1:10, 1:10, "-;;1"); octave-3.2.0:21> legend("foo\\_bar") HTH, c. _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
|
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |