[Scilab-users] Simple Date & Time Plotting

CHEZE David 227480 david.cheze at cea.fr
Fri Jul 20 15:27:53 CEST 2018


Hi samuel,

Thank you for your prompt comments, I fully agree that it's not trivial to have a really nice function with the features you pointed out.
I would find hardly acceptable, from common excel coming users point of view, that Scilab can't offer at least a raw feature to manage this very common task when processing data with timestamps over weeks, months, years therefore I proposed this raw approach.

An extra comments about the function labxdtv: labxdtv uses the automatic x-ticks locations caluclated from datenum values and convert into datevec-Like formats eg YY/MM/DD , MM/DD.hh, DD.hh:mm, hh:mm:ss according to the max span of the level of zoom in the current  display.
If the axis is zoomed or the window size changed, call again labxdtv so that it re-graduates this x-axis (according to datenum values) and convert the new x-ticks into appropriate datevec and automatic choice of the format YY/MM/DD , MM/DD.hh, DD.hh:mm, hh:mm:ss according to the max span of the x-axis.


In your first comment, I 'm not sure to get your point about :
[cid:image001.png at 01D4203B.B4E40A30]

  *   there should not be any shift 17 => 18 => 19. This means that subticking must be completely customized, with a polyline superimposed to the axis, since it is irregular.
In the above example 17, 18 and 19 are years , not days so it's rather normal display. At this level of zoom we have YY/MM/DD but if you manually zoom and change the window size and call again labxdtv() afterwards, you may obtain the following, which allow to see when you :
[cid:image002.png at 01D4203E.390F6B40]
And zoom-in further around 2017 October, then labxdtv() called you may quickly obtain the figure below, so you can read directly that the format is automatically adapted to "MM/DD.HH"  It's not so common format but acceptable to analyze the data on the fly.
[cid:image004.png at 01D4203E.390F6B40]
I find quite important that the graduation on the figure is still relying on datenum, as it is the right underlying numerical format to show date time information.

Cheers,

David

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20180720/05d4b93c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 1708 bytes
Desc: image001.png
URL: <https://lists.scilab.org/pipermail/users/attachments/20180720/05d4b93c/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 13922 bytes
Desc: image002.png
URL: <https://lists.scilab.org/pipermail/users/attachments/20180720/05d4b93c/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 15296 bytes
Desc: image004.png
URL: <https://lists.scilab.org/pipermail/users/attachments/20180720/05d4b93c/attachment-0002.png>


More information about the users mailing list