Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Problem
We often use datetimes on X axis. However, Qt backend's figure options dialog converts these to floating point numbers making it all but possible to edit the axis xmin and xmax.
Proposed Solution
Make the options dialog deal with axis units more properly, e.g. datetimes could be shown usingQDateTimeEdit
widget.
I managed to get this working for datetimes and X axis on a monkey-patched options dialog by replacing line 37 inmatploglib/backends/qt_editor
by
ifisinstance(axes.xaxis.converter,DateConverter):xmin,xmax=tuple(num2date(lim)forliminaxes.get_xlim())else:xmin,xmax=map(float,axes.get_xlim())
Would this be an acceptable way of dealing with the units in general? I would be willing to work on a Pull request on this.