[scilab-Users] tics

sgougeon at free.fr sgougeon at free.fr
Sun Feb 26 23:19:22 CET 2012


Hello,

To change ticks and labels when their number changes, please have
a look in the archives here
http://mailinglists.scilab.org/Customizing-an-Axis-tt2618933.html#a2618934
or there
http://mailinglists.scilab.org/Matplot-with-colorbar-and-negative-values-tt3407767.html#a3420219

Regards
Samuel


----- Mail original -----
De: "grivet" <grivet at cnrs-orleans.fr>
À: users at lists.scilab.org
Envoyé: Vendredi 24 Février 2012 17:22:50
Objet: [scilab-Users] tics

Hi,
Using Scilab 5.3.2 under WinXP/SP3, I have been trying to plot the sine 
function in various ways and I can't manage to get the tiicks the way I 
want.
My first attempt
.
subplot(2,2,1);
plot2d(t,y,style=3,nax=[0,6,0,11]);
a=gca();
a.axes_visible="on";
a.box="on";
a.x_location="origin";
a.data_bounds=[0,-1;5,1];

The x axis is properly labelled but, on the y axis, I get ugly labels 
like 0.257, 0.411, etc; this is true whatever my choice of Ny..
If I don't use nax, labels are reasonable, but too close together.

My seconde attempt

ticy = -1:0.2:1;
ticyl = string(ticy);
ticx = 0:5;
ticxl = string(ticx);
subplot(2,2,1);
plot2d(t,y,style=3);
a=gca();
a.axes_visible="on";
a.box="on";
a.x_location="origin";
a.data_bounds=[0,-1;5,1];
a.x_ticks.locations=ticx;
a.x_ticks.labels=ticxl;
a.y_ticks.locations=ticy;
a.y_ticks.labels=ticyl;

This stops with the error message
   !--error 15
Sous-matrice incorrectement définie.
at line      42 of function generic_i_h called by :
at line       2 of function %s_i_h called by :
a.x_ticks.locations=ticx;

If I ask what ticx is, I get
-->ticx
  tic1x =
     0.    1.    2.    3.    4.    5.

whereas
-->ticy
  ticy  =
          column 1 to 8
   - 1.  - 0.8  - 0.6  - 0.4  - 0.2    0.    0.2    0.4
          column  9 to 11
     0.6    0.8    1.

It seems that ticx and ticy are not of the same nature. If I do ticx = 
0:0.5:5, the code works perfectly, but my labels are crowded..

I would be grateful for any suggestion on how to label axes conveniently.
Thank you for your time and help
JP Grivet




--
To unsubscribe from this mailing-list, please send an empty mail to
users-unsubscribe at lists.scilab.org
To check the archives of this mailing list, see
http://mailinglists.scilab.org/




More information about the users mailing list