<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#330000">
    On 24/02/2012 17:22, grivet wrote:
    <blockquote cite="mid:4F47B95A.7070100@cnrs-orleans.fr" type="cite">Hi,
      <br>
      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.
      <br>
      My first attempt
      <br>
      .
      <br>
      subplot(2,2,1);
      <br>
      plot2d(t,y,style=3,nax=[0,6,0,11]);
      <br>
      a=gca();
      <br>
      a.axes_visible="on";
      <br>
      a.box="on";
      <br>
      a.x_location="origin";
      <br>
      a.data_bounds=[0,-1;5,1];
      <br>
      <br>
      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..
      <br>
      If I don't use nax, labels are reasonable, but too close together.
      <br>
      <br>
      My seconde attempt
      <br>
      <br>
      ticy = -1:0.2:1;
      <br>
      ticyl = string(ticy);
      <br>
      ticx = 0:5;
      <br>
      ticxl = string(ticx);
      <br>
      subplot(2,2,1);
      <br>
      plot2d(t,y,style=3);
      <br>
      a=gca();
      <br>
      a.axes_visible="on";
      <br>
      a.box="on";
      <br>
      a.x_location="origin";
      <br>
      a.data_bounds=[0,-1;5,1];
      <br>
      a.x_ticks.locations=ticx;
      <br>
      a.x_ticks.labels=ticxl;
      <br>
      a.y_ticks.locations=ticy;
      <br>
      a.y_ticks.labels=ticyl;
      <br>
    </blockquote>
    <br>
    Hi<br>
    <br>
    you should modify labels and locations at the same time.<br>
    try something like this:<br>
    <br>
    myticks = a.x_ticks<br>
    myticks.labels = ticxl;<br>
    myticks.locations = ticx;<br>
    <br>
    a.x_ticks = myticks<br>
    <br>
    (same thing for y)<br>
    <br>
    <blockquote cite="mid:4F47B95A.7070100@cnrs-orleans.fr" type="cite">
      <br>
      This stops with the error message
      <br>
        !--error 15
      <br>
      Sous-matrice incorrectement définie.
      <br>
      at line      42 of function generic_i_h called by :
      <br>
      at line       2 of function %s_i_h called by :
      <br>
      a.x_ticks.locations=ticx;
      <br>
      <br>
      If I ask what ticx is, I get
      <br>
      -->ticx
      <br>
       tic1x =
      <br>
          0.    1.    2.    3.    4.    5.
      <br>
      <br>
      whereas
      <br>
      -->ticy
      <br>
       ticy  =
      <br>
               column 1 to 8
      <br>
        - 1.  - 0.8  - 0.6  - 0.4  - 0.2    0.    0.2    0.4
      <br>
               column  9 to 11
      <br>
          0.6    0.8    1.
      <br>
      <br>
      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..
      <br>
      <br>
      I would be grateful for any suggestion on how to label axes
      conveniently.
      <br>
      Thank you for your time and help
      <br>
      JP Grivet
      <br>
      <br>
      <br>
      <br>
      <br>
      --
      <br>
      To unsubscribe from this mailing-list, please send an empty mail
      to
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:users-unsubscribe@lists.scilab.org">users-unsubscribe@lists.scilab.org</a>
      <br>
      To check the archives of this mailing list, see
      <br>
      <a class="moz-txt-link-freetext" href="http://mailinglists.scilab.org/">http://mailinglists.scilab.org/</a>
      <br>
    </blockquote>
    <br>
  </body>
</html>