[Scilab-users] Simple Date & Time Plotting

Samuel Gougeon sgougeon at free.fr
Fri Jul 20 14:52:22 CEST 2018


Le 20/07/2018 à 14:40, Samuel Gougeon a écrit :
> Le 20/07/2018 à 12:20, David Chèze a écrit :
>> Hi Pat and all,
>>
>> I was looking for similar simple feature for plotting time series with
>> readable date time format and I can share an intermediate approach to update
>> the x-ticks with a call to function labxdtv(), cf linked file  labxdtv.sci
>> <http://mailinglists.scilab.org/file/t375348/labxdtv.sci>   
>> There's no callback function, the function is called after the plot action
>> and after every changes in windows size or zoom level : initial plot is like
>> plot2(dtnm,Donnees), with dtnm a vector of datenum values and Donnees a
>> matrix of related data to plot. After the figure is plot at first time or
>> after every changes in windows size or level of zoom, call again labxdtv, it
>> regraduates automatically the x-axis according to the datanum span and
>> convert the datenum in readable date time vector format (auto_ticks are set
>> to on in the function).
>>
>> Would be great to have in scilab a more powerful/flexible builtin
>> function... :)
>
> Sure, but it's a rather complex function. The need was reported 10 
> years ago @ http://bugzilla.scilab.org/6228
> labxdtv() gives a rather raw idea of the task. On it's showcase 
> example, ticks are every 3 months over one year:
>
> But they are not nice:
>
>   * At this scale, major ticks should rather be on the 1st of months.
>   * 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.
>   * here there is only one subtick instead of rather two (for an
>     automatic handling)
>

Even better, subticks could match weeks, for instance on each monday 
00:00:00 (as the default, or as a subticking option).
This means that the first subtick after a major on the 1st at 00:00:00 
will be shifted wrt its leading major, with a shift not equal from a 
major to the next.
Here, having 11-12 weekly subticks between 2 major ticks would be the 
right subticking scale.
If we use some subticks every 10 days instead of weekly ones, there will 
be also some irregularities for 28|29|31-days-long months for setting 
the last subtick.
All these details -- and others -- must be properly processed to really 
have a workable function.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20180720/0c4f6ec2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 1708 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20180720/0c4f6ec2/attachment.png>


More information about the users mailing list