[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Use decimal comma in plots
From: |
Ben Abbott |
Subject: |
Re: Use decimal comma in plots |
Date: |
Wed, 09 Apr 2008 08:36:05 -0700 |
On Wednesday, April 09, 2008, at 11:02AM, "Alexey Torkhov" <address@hidden>
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