-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Qt backend's Figure options to support axis units #19075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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)). |
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 |
Previously axis limits were converted to floats regardless of the actual value type in Qt backend's plot options widget. This commit makes datetime axis limits get converted to actual datetime values which are considerably easier to edit. Also, the methods used to convert the datetime values back have different names under PySide2 and PyQt. Previously the options widget was using the methods provided by PyQt only. We now support both Qt bindings. Re matplotlib#19075
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 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
byWould this be an acceptable way of dealing with the units in general? I would be willing to work on a Pull request on this.
The text was updated successfully, but these errors were encountered: