Use decimal comma in plots

Ben Abbott bpabbott at mac.com
Wed Apr 9 10:36:05 CDT 2008


On Wednesday, April 09, 2008, at 11:02AM, "Alexey Torkhov" <atorkhov at gmail.com> wrote:
>Hi.
>
>I need to use decimal comma in plots instead of dot.
>
>In gnuplot it is possible to set decimalsign ','.
>In matlab:
>xt=get(gca,'xticklabel');
>xt(xt=='.')=',';
>set(gca,'xticklabel',xt);
>
>How to do it in octave?
>
>Alex.

It will depend upon which version of Octave you are using.

I'm running a version build from the bleeding-edge sources (as of Monday).

The following should work, but does not display correctly for me.

x = (0:200)/200;
y = sin(2*pi*x);
plot (x, y)
set (gca, "xticklabel", get (gca, "xtick"))
set (gca, "yticklabel", get (gca, "ytick"))
xt = get (gca, "xticklabel");
yt = get (gca, "yticklabel");
if isnumeric(xt)
  xt = num2str (xt(:));
endif
if isnumeric(yt)
  yt = num2str (yt(:));
endif
xt(xt==".") = ",";
yt(yt==".") = ",";
set (gca, "xticklabel", xt, "yticklabel", yt);

The decimal points remain periods ("."). If someone can verify I'll submit a but report.

Ben


More information about the Help-octave mailing list