[MRG+2] Fix example for matplotlib 2.1 change#9897
Merged
lesteve merged 1 commit intoscikit-learn:masterfrom Oct 10, 2017
Merged
[MRG+2] Fix example for matplotlib 2.1 change#9897lesteve merged 1 commit intoscikit-learn:masterfrom
lesteve merged 1 commit intoscikit-learn:masterfrom
Conversation
[doc build]
Member
Author
|
Compare PR example to dev example The plots look identical: |
Member
Author
|
@jnothman any objections fixing the example rather than pinning the matplotlib version on CircleCI? |
TomDLT
approved these changes
Oct 10, 2017
agramfort
approved these changes
Oct 10, 2017
Member
Author
|
OK self-merging then. |
Member
|
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>
.
|
Member
|
But LGTM
|
Member
Author
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. |
Member
|
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>
.
|
jnothman
pushed a commit
to jnothman/scikit-learn
that referenced
this pull request
Oct 10, 2017
maskani-moh
pushed a commit
to maskani-moh/scikit-learn
that referenced
this pull request
Nov 15, 2017
jwjohnson314
pushed a commit
to jwjohnson314/scikit-learn
that referenced
this pull request
Dec 18, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


In matplotlib 2.1 legend has to be called with either 0, 2 or 3 non keywords arguments.
To reproduce the problem:
Stack-trace: