-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG+2] Fix example for matplotlib 2.1 change #9897
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
Conversation
[doc build]
Compare PR example to dev example The plots look identical: |
@jnothman any objections fixing the example rather than pinning the matplotlib version on CircleCI? |
OK self-merging then. |
This is a bug in matplotlib. Is it our job to fix?
…On 10 October 2017 at 18:01, Loïc Estève ***@***.***> wrote:
In matplotlib 2.1 legend has to be called with either 0, 2 or 3 non
keywords arguments.
To reproduce the problem:
ipython examples/neural_networks/plot_mlp_training_curves.py
Stack-trace:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~/dev/alt-scikit-learn/examples/neural_networks/plot_mlp_training_curves.py in <module>()
86 plot_on_dataset(*data, ax=ax, name=name)
87
---> 88 fig.legend(ax.get_lines(), labels=labels, ncol=3, loc="upper center")
89 plt.show()
/volatile/le243287/miniconda3/lib/python3.6/site-packages/matplotlib/figure.py in legend(self, *args, **kwargs)
1518
1519 else:
-> 1520 raise TypeError('Invalid number of arguments passed to legend. '
1521 'Please specify either 0 args, 2 args '
1522 '(artist handles, figure labels) or 3 args '
TypeError: Invalid number of arguments passed to legend. Please specify either 0 args, 2 args (artist handles, figure labels) or 3 args (artist handles, figure labels, legend location)
------------------------------
You can view, comment on, or merge this pull request online at:
#9897
Commit Summary
- Fix example for matplotlib 2.1 change.
File Changes
- *M* build_tools/circle/build_doc.sh
<https://github.com/scikit-learn/scikit-learn/pull/9897/files#diff-0>
(2)
- *M* examples/neural_networks/plot_mlp_training_curves.py
<https://github.com/scikit-learn/scikit-learn/pull/9897/files#diff-1>
(2)
Patch Links:
- https://github.com/scikit-learn/scikit-learn/pull/9897.patch
- https://github.com/scikit-learn/scikit-learn/pull/9897.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9897>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAEz63c1mbS3dhB-dzkanwMWt_wBaWAJks5sqxYygaJpZM4PzdbV>
.
|
But LGTM
|
I could not find anything by quickly googling, maybe it is worth opening an issue if you think this is a bug. I guess from matplotlib 2.0.2 doc it looks like you could specify Having said that I think it is still worth fixing so that master is compatible with matplotlib 2.1. |
It is a bug: matplotlib/matplotlib#9320 But yes,
it's good to fix this here anyway.
…On 10 October 2017 at 20:55, Loïc Estève ***@***.***> wrote:
This is a bug in matplotlib. Is it our job to fix?
I could not find anything by quickly googling, maybe it is worth opening
an issue if you think this is a bug. I guess from matplotlib 2.0.2 doc it
looks like you could specify labels by keyword argument:
https://matplotlib.org/2.0.2/api/figure_api.html?highlight=
legend#matplotlib.figure.Figure.legend
Having said that I think it is still worth fixing so that master is
compatible with matplotlib 2.1.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9897 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6z2_kvxvajfN2Gyx8m--M_FhuJFZks5sqz8bgaJpZM4PzdbV>
.
|
In matplotlib 2.1 legend has to be called with either 0, 2 or 3 non keywords arguments.
To reproduce the problem:
Stack-trace: