<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>