<div dir="ltr">Thank you very much!<div>I like this idea because the range is indeed small compared to the starting time, I think I will use this approach!<br><br></div><div>Regards</div><div>Florian</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-09 20:28 GMT+01:00 Samuel Gougeon <span dir="ltr"><<a href="mailto:sgougeon@free.fr" target="_blank">sgougeon@free.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>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<span class="HOEnZb"><font color="#888888"><br>
Samuel Gougeon</font></span><div><div class="h5"><br>
<br>
Le 09/12/2015 18:37, Florian Winter a écrit :<br>
</div></div></div>
<blockquote type="cite"><div><div class="h5">
<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></fieldset>
<br>
</div></div><span class=""><pre>_______________________________________________
users mailing list
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</span></blockquote>
<br>
</div>
<br>_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>