<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi,<br>
      In that case, since the time range is small compared to the
      starting time, i would use simply<br>
      <br>
      plot(time-63600, values)<br>
      xlabel("17:40:00 + [s]")<br>
      <br>
      Regards<br>
      Samuel Gougeon<br>
      <br>
      Le 09/12/2015 18:37, Florian Winter a écrit :<br>
    </div>
    <blockquote
cite="mid:CAE_7x9z3JJxmyjMa-g185ON5xF6ixrPKth-hMGtKFpdk=WxcdA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi,
        <div>I have a problem. I get data about the time from a file in
          UT. That means I get the number of seconds elapsed on the day
          instead of a "normal" time (e.g. 63602 actually means
          17:40:02)</div>
        <div><br>
        </div>
        <div>I'm trying to plot some values with this time but to make
          it more readable I would like to use "17:40:02" for the ticks
          on the x-axis instead of the seconds,</div>
        <div>so I wrote a function to convert the seconds to a string.</div>
        <div><br>
        </div>
        <div>If I don't change the ticks to the custom strings it
          automatically only shows 7 ticks but if I change it like I
          did, it shows the ticks for every single value I use and the
          whole thing becomes sort of unreadable.</div>
        <div>Is there a possibility to convert the time differently or
          can I somehow limit the number of ticks that should be drawn?</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
          <div>///////////////////////////////////////////////////////////////////////</div>
          <div>
            <div>time = [63602,63602.05,63603,63603.5,63604,63606]</div>
            <div>values = [1,2,3,4,5,7]</div>
            <div><br>
            </div>
            <div>function convertedtime = timestring(UT) //converts UT</div>
            <div>    h=int(UT/3600);</div>
            <div>    UT=UT-h*3600;</div>
            <div>    m=int(UT/60);</div>
            <div>    UT=UT-m*60;</div>
            <div>    if UT < 10 then</div>
            <div>        convertedtime = string(h) + ":" + string(m) +
              ":0" + string(UT);</div>
            <div>    else</div>
            <div>        convertedtime = string(h) + ":" + string(m) +
              ":" +string(UT);</div>
            <div>    end</div>
            <div>endfunction</div>
            <div><br>
            </div>
            <div>newtime = timestring(time);</div>
            <div><br>
            </div>
            <div>plot(time,values);</div>
            <div>a=gca();</div>
            <div>ticks = a.x_ticks</div>
            <div>ticks.labels=newtime</div>
            <div>ticks.locations=time</div>
            <div>a.x_ticks=ticks</div>
          </div>
          <div><br>
          </div>
          <div>////////////////////////////////////////////////////////////</div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Flotschos</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>