You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Qt backend's Figure options to support axis units #19075
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 using QDateTimeEdit widget.
I managed to get this working for datetimes and X axis on a monkey-patched options dialog by replacing line 37 in matploglib/backends/qt_editor by
That seems reasonable (in the absence of having a way to get unitized limits back, but I guess that's not going to happen until we have a general unconverter (#12270, #16922)).
Note that I'd guess the patch at #18958 (comment) would still be needed to support PySide2, though.
Right, thats a reasonable hack for one converter, but not for units in general. I'd be mildly against having a bunch of special casing of dates, but maybe its worth the pain?
I cannot say I am fully happy with the isinstance() solution myself so I am all ears if there is a better way to do this. Maybe this could work as a stopgap solution until something like a general unconverted gets implemented, though?
Activity
anntzer commentedon Dec 7, 2020
That seems reasonable (in the absence of having a way to get unitized limits back, but I guess that's not going to happen until we have a general unconverter (#12270, #16922)).
Note that I'd guess the patch at #18958 (comment) would still be needed to support PySide2, though.
jklymak commentedon Dec 7, 2020
Right, thats a reasonable hack for one converter, but not for units in general. I'd be mildly against having a bunch of special casing of dates, but maybe its worth the pain?
soininen commentedon Dec 8, 2020
I cannot say I am fully happy with the
isinstance()solution myself so I am all ears if there is a better way to do this. Maybe this could work as a stopgap solution until something like a general unconverted gets implemented, though?Convert axis limit units in Qt plot options widget
Add more unit tests for Qt backend
Fix unit tests on systems without Qt
Fix unit tests on systems without Qt backend
Merge two unit tests into one.