[scilab-Users] Specifying the y_ticks of my graphic by hand
Stefan Du Rietz
sdr at durietz.se
Mon Sep 1 14:23:16 CEST 2008
You have to do it this way in order to change both at the same time:
yt = [0;0.5;1;1.5;2;2.5;3];
ytl = ["0.0";"0.5";"1.0";"1.5";"2.0";"2.5";"3.0"];
a.y_ticks = tlist(["ticks","locations","labels"], yt, ytl);
/Stefan
On 2008-09-01 13:09, Oliver Demetz wrote:
--------------------
> Hi,
> have a graphic window like
>
> plot2d( linspace(0,2,5),linspace(0,3,5));
>
> ok, now I would like to specify the ticks of the axis by hand:
>
> a=gca()
>
> gives me
>
> a.y_ticks.locations = [0;0.5;1;1.5;2;2.5;3]
> a.y_ticks.labels = ["0.0";"0.5";"1.0";"1.5";"2.0";"2.5";"3.0"]
>
> but if I would like to use these ticks:
>
> a.y_ticks.locations = [0;1;2;3]
> a.y_ticks.labels = ["a";"first";"test";"test"]
>
> but it fails with a not really understandable error message.
> I think the problem is that the *number* of ticks is different.
> Therefore, scilab refuses to change the vectors.
>
> Please help!
>
> Thanks in advance,
> Oliver
>
More information about the users
mailing list