Post by JevI wonder if it is possible to plot a numeric vector against datetime
vector and adjust the axis labels accordingly. Could not find
something like this in examples or documentation. Any ideas?
I implemented this as a tool in an extension of guiqwt of my own project. It
is called TimeAxisTool.
The original code is in a bigger project with many dependencies
(https://www.tango-
controls.org/static/taurus/development/doc/html/devel/api/taurus/qt/qtgui/extra_guiqwt.html),
but I extracted the relevant parts and I put them in the attached files.
For testing, just run "python timeaxistool.py" and use the "Time Scale" option
from the context menu for changing the scale mode.
Note: When a scale is in "time" mode, the values are expected to be timestamps
and will be shown as properly edited date/times.
Note to Pierre (author of guiqwt): please feel free to add/adapt this code to
the official guiqwt if you think it is worth it. Also, apart from
DateTimeScaleEngine, the scales.py module contains two other useful scale
engines (DeltaTimeScaleEngine, FixedLabelsScaleEngine).
I hope this helps,
Carlos
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
Cells / Alba Synchrotron [http:/www.cells.es]
Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3
E-08290 Cerdanyola del Valles (Barcelona), Spain
E-mail: cpascual-***@public.gmane.org
Phone: +34 93 592 4428
+----------------------------------------------------+