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
Patch edgecolor of a legend item does not follow look of figure #7375
It's not about the edgecolor of the legend box, but of the legend items (if they are a patch). In the following example, the clear border around the patches in the legend is a bit surprising to me, and contrasts the look of the figure itself.
This issue now surfaces because the default changed to no border for patches, and as such for the histogram in this example (before 2.0, this would not be an issue with the default look). And it becomes more apparent due to the use of a lower alpha in this specific example.
Not sure if this is still the case with master, but I tested with matplotlib 2.0.0b4, on Python 3.5 / Ubuntu (installed from conda-forge)
i.e. the edgecolor of the legend patch inherits the alpha value set by default.
Fundamentally, this is again a consequence of the design choice of having alpha as a separate attribute, when it should really be part of the color spec (of course this doesn't prevent having helper functions to access and modify the alpha value).
As a stopgap measure, I think we can fix to_rgba (and friends) to have a force_alpha=True kwarg, and use force_alpha=False here in the meaning of "use the alpha value from the color itself if it specifies one". But I'd say that ultimately, removing internal use of a separate alpha attribute (which can be done without changing the public API) is the way to go.
Activity
anntzer commentedon Nov 2, 2016
The culprit is https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/patches.py#L295
i.e. the edgecolor of the legend patch inherits the alpha value set by default.
Fundamentally, this is again a consequence of the design choice of having alpha as a separate attribute, when it should really be part of the color spec (of course this doesn't prevent having helper functions to access and modify the alpha value).
As a stopgap measure, I think we can fix
to_rgba(and friends) to have aforce_alpha=Truekwarg, and useforce_alpha=Falsehere in the meaning of "use the alpha value from the color itself if it specifies one". But I'd say that ultimately, removing internal use of a separate alpha attribute (which can be done without changing the public API) is the way to go.BUG: in Patch.update_from, use private variables directly. Closes mat…
Merge pull request #7497 from efiring/patch_update_from
NelleV commentedon Nov 22, 2016
closed in #7497