8000 [MRG+1] Matplotlib v2update by alisonspencer · Pull Request #8514 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG+1] Matplotlib v2update #8514

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

Merged
merged 5 commits into from
Mar 9, 2017
Merged

[MRG+1] Matplotlib v2update #8514

merged 5 commits into from
Mar 9, 2017

Conversation

alisonspencer
Copy link

Reference Issue

Fixing plot appearance for matplotlib v2 compatibility in #8364

What does this implement/fix? Explain your changes.

Added 'edgecolor' option to scatterplots to make dots easier to see

Any other comments?

plt.plot(X_test, y_1, color="cornflowerblue", label="max_depth=2", linewidth=2)
plt.plot(X_test, y_2, color="yellowgreen", label="max_depth=5", linewidth=2)
plt.scatter(X, y, c="darkorange", edgecolor='k', label="data")
plt.plot(X_test, y_1, color="cornflowerblue", edgecolor='k',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does plt.plot have an argument edgecolor?

plt.scatter(X, y, c="darkorange", edgecolor='k', label="data")
plt.plot(X_test, y_1, color="cornflowerblue", edgecolor='k',
label="max_depth=2", linewidth=2)
plt.plot(X_test, y_2, color="yellowgreen", edgecolor='k',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@jmschrei
Copy link
Member
jmschrei commented Mar 4, 2017

Thanks for the contributions! Please see my comment

@codecov
Copy link
codecov bot commented Mar 4, 2017

Codecov Report

Merging #8514 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #8514   +/-   ##
=======================================
  Coverage   95.48%   95.48%           
=======================================
  Files         342      342           
  Lines       60913    60913           
=======================================
  Hits        58160    58160           
  Misses       2753     2753

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cdd693b...c67045d. Read the comment docs.

@codecov
Copy link
codecov bot commented Mar 4, 2017

Codecov Report

Merging #8514 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #8514      +/-   ##
==========================================
+ Coverage   95.48%   95.48%   +<.01%     
==========================================
  Files         342      342              
  Lines       60913    61013     +100     
==========================================
+ Hits        58160    58259      +99     
- Misses       2753     2754       +1
Impacted Files Coverage Δ
sklearn/model_selection/_split.py 98.6% <0%> (-0.17%)
sklearn/ensemble/gradient_boosting.py 95.79% <0%> (ø)
sklearn/model_selection/init.py 100% <0%> (ø)
sklearn/feature_selection/univariate_selection.py 99.46% <0%> (ø)
sklearn/calibration.py 98.87% <0%> (ø)
sklearn/gaussian_process/tests/test_kernels.py 98.86% <0%> (+0.01%)
sklearn/metrics/tests/test_common.py 99.52% <0%> (+0.01%)
sklearn/utils/estimator_checks.py 93.36% <0%> (+0.08%)
sklearn/model_selection/tests/test_split.py 95.96% <0%> (+0.25%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cdd693b...e64f8f6. Read the comment docs.

@amueller
Copy link
Member
amueller commented Mar 4, 2017

You can post a link to the generated HTML by linking to the output of circle. I keep forgetting how to easily get the link though :-/

@amueller
Copy link
Member
amueller commented Mar 4, 2017

http://scikit-learn.org/circle?{BUILD_NUMBER}

@amueller
Copy link
Member
amueller commented Mar 4, 2017

@katelie indeed, and so that the reviewers can check it without building the documentation themselves.
Travis is still giving an error.

@jmschrei
Copy link
Member
jmschrei commented Mar 4, 2017

Thanks for the links @katelie. I'm not seeing too much of a difference in the first two figures, and just darker grid lines in the last example. Is that intentional?

@amueller
Copy link
Member
amueller commented Mar 4, 2017

Hm I'm not we need the edges in these ones, they look fine to me without them. Sorry if the explanation of the issue was unclear @katelie

@alisonspencer
Copy link
Author

@jmschrei @amueller Okay, not a problem. It is subtle. I thought part of the issue was to make the examples look consistent with the past behavior with matplotlib v1.

@amueller
Copy link
Member
amueller commented Mar 4, 2017

@katelie it just needs to look decent. Many of the examples were completely meaningless because the points were the same color as the background. So we mostly want the example to show the same point and look decent. It doesn't need to look the same way.

@jmschrei
Copy link
Member
jmschrei commented Mar 4, 2017

This PR is functional and adds in a minor improvement in the grid lines even if the other figures seem mostly unchanged. @amueller should we merge or close this?

@GaelVaroquaux
Copy link
Member

I am +0 for merge.

@lesteve
Copy link
Member
lesteve commented Mar 6, 2017

This PR is functional and adds in a minor improvement in the grid lines even if the other figures seem mostly unchanged.

😕 are you comparing against the dev doc?

master:

this PR:

Without edgecolor it is rather hard to see the light grey points.

Personally I prefer having edgecolors for scatter plots with overlapping data points so I am +1 on this.

@lesteve lesteve changed the title Matplotlib v2update [MRG+1] Matplotlib v2update Mar 6, 2017
@jmschrei
Copy link
Member
jmschrei commented Mar 6, 2017

I think there is a major difference there. If I google the example, I see the following:

stable (http://scikit-learn.org/stable/auto_examples/decomposition/plot_pca_iris.html):
image

new:
image

@NelleV
Copy link
Member
NelleV commented Mar 6, 2017

I don't think the change helps for the decision trees example nor the multi-output decision tree output.
It does greatly improve the PCA one.

@lesteve
Copy link
Member
lesteve commented Mar 6, 2017

@jmschrei you should compare the PR rendering against the dev doc not the stable one. The stable doc does not use matplotlib 2. In the case you mention you should be looking at http://scikit-learn.org/dev/auto_examples/decomposition/plot_pca_iris.html.

@lesteve
Copy link
Member
lesteve commented Mar 6, 2017

@NelleV maybe it is a matter of habit but as I said above, scatter plots with overlapping data points without edgecolor looks a bit weird (maybe smudgy if I had to pick another word) to me. I just put the other images here for easier comparison.

plot_tree_regression_multioutput

dev doc:

this PR:

plot_tree_regression

dev doc:

this PR:

@lesteve
Copy link
Member
lesteve commented Mar 6, 2017

@NelleV maybe it is a matter of habit but as I said above, scatter plots with overlapping data points without edgecolor looks a bit weird (maybe smudgy if I had to pick another word) to me.

I don't think we should spent too much time on this though and I am more than fine merging only the change to plot-pca-iris.

@lesteve
Copy link
Member
lesteve commented Mar 9, 2017

OK let's not let this one die. I just left the changes for plot_pca_iris and I am going to merge this one.

@lesteve lesteve merged commit 34a3c99 into scikit-learn:master Mar 9, 2017
@lesteve
Copy link
Member
lesteve commented Mar 9, 2017

Thanks @katelie !

@Przemo10 Przemo10 mentioned this pull request Mar 17, 2017
herilalaina pushed a commit to herilalaina/scikit-learn that referenced this pull request Mar 26, 2017
massich pushed a commit to massich/scikit-learn that referenced this pull request Apr 26, 2017
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
NelleV pushed a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0