Repository navigation
Closed
Milestone
Description
For instance:
import matplotlib
import matplotlib.pyplot as plt
matplotlib.style.use('default')
plt.plot(range(10))
plt.show()raises
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'webagg.port_retries', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'datapath', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'figure.max_open_warning', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'timezone', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'backend.qt4', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'toolbar', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'savefig.directory', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'tk.window_focus', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'backend_fallback', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'webagg.open_in_browser', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'backend', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'interactive', that is not related to style. Ignoring
"style. Ignoring".format(key))
/usr/local/lib/python3.5/site-packages/matplotlib/style/core.py:52: UserWarning: Style includes a parameter, 'webagg.port', that is not related to style. Ignoring
Activity
jenshnielsen commentedon Jan 1, 2016
This happens every time the test suite runs a test with the default style rather than the classic style after the merge of #5440
mdboom commentedon Jan 1, 2016
I think this is due to the 11th hour addition of d9d1671 in #5440. Obviously that will have to be done differently -- probably to ignore, but not warn about, blacklisted parameters.
efiring commentedon Jan 1, 2016
But ordinarily one would want the warning, so maybe a
warn=Truekwarg is needed, that can be set to False in d9d1671.jenshnielsen commentedon Jan 1, 2016
@efiring I agree. I think it would be ok to add a
warnkwarg to_apply_styleand pass it on to_remove_blacklisted_style_paramswhich defaults to True and just set this to False when the default style is used.mdboom commentedon Jan 1, 2016
Yes -- I am only suggesting suppressing the warning when
defaultis applied, which by necessity must have blacklisted parameters in it that should be ignored when using it as a style.jenshnielsen commentedon Jan 1, 2016
Cool Im happy to do a PR with that now
Fix matplotlib#5777. Don't warn when applying default style
mdboom commentedon Jan 1, 2016
Sorry -- didn't see your comment before I just made a PR (#5778). We can do that, or use a kwarg to disable warnings, as you suggest. I don't really have strong feelings either way.
jenshnielsen commentedon Jan 1, 2016
Neither do I but I guess #5778 requires slightly less modification so I will merge that when travis passes and we are sure it works
Merge pull request #5778 from mdboom/blacklist-warning
Merge pull request matplotlib#5778 from mdboom/blacklist-warning