Discussion:
[Scilab-users] Simple Date & Time Plotting
Pat
2013-01-29 17:30:03 UTC
Permalink
Hi All,

I would like to find a simple plotting function to enable a plot of numeric
data against *date/time * to be obtained.

I have read numerous workarounds to this problem from input over the years -
usually involving manually manipulating X-Tick Text Data.
I'm just not sure how the graph would show X-axes labels if you zoomed on
into the plot from, say, a 12-month time period right into a 24-hr time
window within it.?
Would I have to run another script to help the plotter out?

In summary:
I would like to plot data Vs Date/Time such that it can automatically
re-adjust the x-axis minor tick marks given the time span when zooming in -
(X-axis in Date-Time format throughout).

Thanks in advance,

Patrick



--
View this message in context: http://mailinglists.scilab.org/Simple-Date-Time-Plotting-tp4025833.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
Serge Steer
2013-01-29 18:58:20 UTC
Permalink
I'm afraid it is yet not possible with the default zoom tool becausefor
this behavior it should be necessary to have the possibility to attach a
callback function that responds to the zoom the resize actions

But you can develop your own zoom menu for zooming time séries....
Serge Steer
Post by Pat
Hi All,
I would like to find a simple plotting function to enable a plot of numeric
data against *date/time * to be obtained.
I have read numerous workarounds to this problem from input over the years -
usually involving manually manipulating X-Tick Text Data.
I'm just not sure how the graph would show X-axes labels if you zoomed on
into the plot from, say, a 12-month time period right into a 24-hr time
window within it.?
Would I have to run another script to help the plotter out?
I would like to plot data Vs Date/Time such that it can automatically
re-adjust the x-axis minor tick marks given the time span when zooming in -
(X-axis in Date-Time format throughout).
Thanks in advance,
Patrick
--
View this message in context: http://mailinglists.scilab.org/Simple-Date-Time-Plotting-tp4025833.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
http://lists.scilab.org/mailman/listinfo/users
Pat
2013-01-30 08:45:45 UTC
Permalink
Thanks for the prompt response Serge,

I'm afraid that type of function would be well beyond me!
Will be interested to see if anyone on the forum has tried to develop something similar in recent times.

Thanks again,

Patrick


From: Serge Steer [via Scilab / Xcos - Mailing Lists Archives] [mailto:ml-node+***@n3.nabble.com]
Sent: 29 January 2013 18:59
To: Blee, Patrick
Subject: Re: Simple Date & Time Plotting

I'm afraid it is yet not possible with the default zoom tool because for this behavior it should be necessary to have the possibility to attach a callback function that responds to the zoom the resize actions

But you can develop your own zoom menu for zooming time séries....
Serge Steer

Le 29/01/2013 18:30, Pat a écrit :

Hi All,



I would like to find a simple plotting function to enable a plot of numeric

data against *date/time * to be obtained.



I have read numerous workarounds to this problem from input over the years -

usually involving manually manipulating X-Tick Text Data.

I'm just not sure how the graph would show X-axes labels if you zoomed on

into the plot from, say, a 12-month time period right into a 24-hr time

window within it.?

Would I have to run another script to help the plotter out?



In summary:

I would like to plot data Vs Date/Time such that it can automatically

re-adjust the x-axis minor tick marks given the time span when zooming in -

(X-axis in Date-Time format throughout).



Thanks in advance,



Patrick







--

View this message in context: http://mailinglists.scilab.org/Simple-Date-Time-Plotting-tp4025833.html

Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.

_______________________________________________

users mailing list

[hidden email]</user/SendEmail.jtp?type=node&node=4025834&i=0>

http://lists.scilab.org/mailman/listinfo/users




_______________________________________________
users mailing list
[hidden email]</user/SendEmail.jtp?type=node&node=4025834&i=1>
http://lists.scilab.org/mailman/listinfo/users

________________________________
If you reply to this email, your message will be added to the discussion below:
http://mailinglists.scilab.org/Simple-Date-Time-Plotting-tp4025833p4025834.html
To unsubscribe from Simple Date & Time Plotting, click here<http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4025833&code=UGF0cmljay5CbGVlQGludmlzdGEuY29tfDQwMjU4MzN8LTEzMjIyMjEwNzc=>.
NAML<http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://mailinglists.scilab.org/Simple-Date-Time-Plotting-tp4025833p4025840.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
David Chèze
2018-07-20 10:20:36 UTC
Permalink
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... :)

David



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
Samuel Gougeon
2018-07-20 12:40:49 UTC
Permalink
Post by David Chèze
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)
* etc..

So yes, a powerful function formating dates would be nice. But
implementing a really nice and useful one is definitely not trivial.

Cheers
Samuel

PS : there is presently no event triggered by zooming or panning an axes.
Samuel Gougeon
2018-07-20 12:52:22 UTC
Permalink
Post by Samuel Gougeon
Post by David Chèze
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
labxdtv() gives a rather raw idea of the task. On it's showcase
* 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.
CHEZE David 227480
2018-07-20 13:27:53 UTC
Permalink
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:***@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:***@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:***@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
Samuel Gougeon
2018-07-20 16:33:06 UTC
Permalink
Post by CHEZE David 227480
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.
The problem with proposing an official function in a only raw version is
that it becomes a commitment.
Then changing it is more difficult because backcompatibility issues must
be avoided or/and handled.
This is why, to me, it is better to propose such a version on the
fileexchange, that is more informal.
Post by CHEZE David 227480
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.
My PS meant that there is no equivalence of gcf().resizefcn for zooming.
So, recalling labxdtv() must be done /intentionnally, by hand,/ after
zooming or spanning an axes.
Post by CHEZE David 227480
* 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.
My fault! As aa/bb/cc is in french the common format for dd/mm/yy, I
paid attention only to the first aa/bb, taking them for days/months.
Beside this misunderstanding, the discussion and remarks remain the
same: then we could rather expect majors ticks always on 1st of some
months, and smart subticks accordingly.
Post by CHEZE David 227480
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
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.
Usual commonly spread formats are quite known and shared.
AFAIK, the most standard one is YYYY-MM-DD HH:MN:SS.ssss, with possible
truncation.
Post by CHEZE David 227480
.../...
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.
IMO, the input format should be customizable though an input option :

* absolute formats : unix time, julian days, excel time, ... + linear
(s, days, s..) vs vectorized (datenum, etc)
* relative formats (without origin) : in s, mn, h, days

Best regards
Samuel
Samuel Gougeon
2018-07-20 16:40:05 UTC
Permalink
Post by Samuel Gougeon
My PS meant that there is no equivalence of gcf().resizefcn for
zooming. So, recalling labxdtv() must be done /intentionnally, by
hand,/ after zooming or spanning an axes.
Please read "zooming and *p*anning"
Post by Samuel Gougeon
Post by CHEZE David 227480
.../...
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.
* absolute formats : unix time, julian days, excel time, ... +
linear (s, days, s..) vs vectorized (datenum, etc)
* relative formats (without origin) : in s, mn, h, days
May be speaking about absolute/relative *scales*, in a linearized or
vectorized *format* would be clearer.
CHEZE David 227480
2018-07-23 09:35:46 UTC
Permalink
Hi Samuel,

Thank you for the comments and the discussion, I find it achieves some progress in the definition of the specifications of such a future feature. Do you assume it could be relevant to put it in the list of topics for SEP / GSOC / ... ?

Regards,

David

De : users <users-***@lists.scilab.org> De la part de Samuel Gougeon
Envoyé : vendredi 20 juillet 2018 18:40
À : Users mailing list for Scilab <***@lists.scilab.org>
Objet : Re: [Scilab-users] Simple Date & Time Plotting

Le 20/07/2018 à 18:33, Samuel Gougeon a écrit :

My PS meant that there is no equivalence of gcf().resizefcn for zooming. So, recalling labxdtv() must be done intentionnally, by hand, after zooming or spanning an axes.

Please read "zooming and panning"




.../...

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.
IMO, the input format should be customizable though an input option :

* absolute formats : unix time, julian days, excel time, ... + linear (s, days, s..) vs vectorized (datenum, etc)
* relative formats (without origin) : in s, mn, h, days

May be speaking about absolute/relative scales, in a linearized or vectorized format would be clearer.
Samuel Gougeon
2018-07-23 11:04:22 UTC
Permalink
Hello David,
Post by CHEZE David 227480
Hi Samuel,
Thank you for the comments and the discussion, I find it achieves some
progress in the definition of the specifications of such a future
feature. Do you assume it could be relevant to put it in the list of
topics for SEP / GSOC / … ?
Yes, indeed, IMO adding a strdate(), and maybe some ticksperiod(),
functions to Scilab would be useful.
Designing them will require a SEP and further discussion.

Best regards
Samuel

Loading...