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
ActionBar images look wrong (different) in matplotlib 2.0.0 #47
I was assuming that LooseVersion knew enough about version names to properly grok that 2.0.0 was greater than 2.0.0rc1 -- but it doesn't test that way. Should be:
I'll submit a pull request. After that fix, we get this:
The error bars have no caps, but that's because Matplotlib silently decided to remove them by default, substituting instead thicker lines. Note that "figure.facecolor" is still not working.
Apparently the MPL images have been redone to have a modern 'flat' appearance, so something different should be done for the Kivy backend. Either use the old 1.4.3 images (by pulling from a subdirectory of garden.matplotlib), or doing some imaging to make them white-on-black for the actionbar. I don't think I'll tackle that.
And the reason there's no gray border around the plot is that 'figure.facecolor' is new since 1.4.3, and now defaults to 'w', which means "white". So, you can get the previous behavior (mostly, except for the icons) with this:
from distutils.version import LooseVersion
import matplotlib
_mpl_ge_2_0 = LooseVersion(matplotlib.__version__) >= LooseVersion('2.0.0')
if _mpl_ge_2_0:
# restore interface changes in 2.x so that we can compare plots with 1.4.3 directly
# 1. Lines no longer drawn around solid patches (pie chart segments, bars in bar graph)
matplotlib.rcParams['patch.force_edgecolor'] = True
matplotlib.rcParams['patch.facecolor'] = 'b'
# 2. No caps on error bars
matplotlib.rcParams['errorbar.capsize'] = 3
# 3. Different facecolor for figure
matplotlib.rcParams['figure.facecolor'] = 'lightgray'
I suppose if someone has the time and wants to champion it we may be able to get it into mpl. The code was never quite finished, in particular the docs, so it'd need someone to dedicate some time to it.
Activity
janssen commentedon Feb 2, 2017
And here's the same case with 1.4.3, which is clearly the only one drawn correctly, the only one with error bars:
matham commentedon Feb 2, 2017
Probably something in http://matplotlib.org/api/api_changes.html.
janssen commentedon Feb 2, 2017
The 2.0.0 case is a result of a bad comparison in my code:
I was assuming that LooseVersion knew enough about version names to properly grok that 2.0.0 was greater than 2.0.0rc1 -- but it doesn't test that way. Should be:
I'll submit a pull request. After that fix, we get this:
The error bars have no caps, but that's because Matplotlib silently decided to remove them by default, substituting instead thicker lines. Note that "figure.facecolor" is still not working.
janssen commentedon Feb 2, 2017
I see that image drawing was "almost completely re-written" for 2.0, which may explain the actionbar image issues.
janssen commentedon Feb 2, 2017
Similarly, the outlines are no longer drawn around the bars by design.
janssen commentedon Feb 2, 2017
Apparently the MPL images have been redone to have a modern 'flat' appearance, so something different should be done for the Kivy backend. Either use the old 1.4.3 images (by pulling from a subdirectory of garden.matplotlib), or doing some imaging to make them white-on-black for the actionbar. I don't think I'll tackle that.
matham commentedon Feb 2, 2017
Thanks for your research. I guess a pr for the version change should be enough for the most important stuff.
It does make me wonder though if mpl will keep breaking things :(
janssen commentedon Feb 2, 2017
And the reason there's no gray border around the plot is that 'figure.facecolor' is new since 1.4.3, and now defaults to 'w', which means "white". So, you can get the previous behavior (mostly, except for the icons) with this:
janssen commentedon Feb 2, 2017
The matplotlib crew fixed all the backends they maintain. I guess the thing to do would be to get them to take over this one.
matham commentedon Feb 2, 2017
I suppose if someone has the time and wants to champion it we may be able to get it into mpl. The code was never quite finished, in particular the docs, so it'd need someone to dedicate some time to it.