Labels become colors in figure options in qt backends #4303
Labels
Difficulty: Easy
https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
GUI: Qt
status: confirmed bug
Milestone
Hi everyone,
I noticed a small issue in the implementation of the figure options panel inside the navigation tool bar for qt. If a plot as a name of a valid color in matplotlib, the field in the figure options becomes a color field and the label is converted into an hexadecimal color. The name of the curve is then affected by this change, since a later call to legend show that it has the hexadecimal color name. Since it is frequent I think to make plots with one letter name (y vs x), it would be nice to correct it.
The problem, looking at the source, is that the formlayout code has been modified to check if the value in a field is a valid matplotlib color, and if it is the case, returns a color field, converting the name of the color into hexadecimal. I think that such things should not be checked inside the formlayout code, but that colors should be explicitly converted into valid text color before submitting them to create a layout, for the field that are colors (here inside matplotlib.backend.qt_editor.figureoptions.py).
The problem appears with all fields. Opening the panel, setting the axes title to "y", validating and closing, reopening again the panel shows the problem.
I can make a PR if you want but not now (I must read the guidelines before...)
The text was updated successfully, but these errors were encountered: