[MRG+1] Fix: Replace pylab with matplotlib.pyplot #6754#6762
Merged
TomDLT merged 37 commits intoscikit-learn:masterfrom May 10, 2016
Merged
[MRG+1] Fix: Replace pylab with matplotlib.pyplot #6754#6762TomDLT merged 37 commits intoscikit-learn:masterfrom
TomDLT merged 37 commits intoscikit-learn:masterfrom
Conversation
- one instance of 22 occurrences of pylab replaced with matplotlib.pyplot - bench_glm.py now free of pylab references - code executes properly
Member
|
there is only one file changed in this PR so far |
- one instance of 21 remaining occurrences of pylab replaced with
matplotlib.pyplot
- bench_glmnet.py now free of pylab references
- code does not execute for extraneous reason: ImportError: No module named
glmnet.elastic_net
- one instance of 19 occurrences of pylab replaced with matplotlib.pyplot - bench_lasso.py now free of pylab references - code executes properly
- one instance of 18 occurrences of pylab replaced with matplotlib.pyplot - bench_plot_neighbors.py now free of pylab references - code executes properly
- one instance of 17 occurrences of pylab replaced with matplotlib.pyplot
- bench_plot_omp_lars.py now free of pylab references
- code does not execute for extraneous reasons:
- File "bench_plot_omp_lars.py", line 111, in <module>
- ax = fig.add_subplot(1, 2, i)
- ValueError: num must be 1 <= num <= 2, not 0
- line 111 should probably be ax = fig.add_subplot(1, 2, i+1)
- bench_plot_parallel_pairwise.py now free of pylab references - code executes properly
- bench_plot_ward.py now free of pylab references - code executes properly
- bench_sgd_regression.py now free of pylab references - code executes properly
- bench_tree.py now free of pylab references - code executes properly
benchmarks/bench_glm.py
Outdated
| if __name__ == '__main__': | ||
|
|
||
| import pylab as pl | ||
| import matplotlib.pyplot as pl |
Member
There was a problem hiding this comment.
standard import name is plt
please change all occurrences.
thanks
- replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_glm.py clean
- replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_glm.py clean of pl - code does not execute for extraneous reasons
- replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_lasso.py clean of pl - code executes properly
- replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_neighbors.py clean of pl - code executes properly
- replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_omp_lars.py clean of pl - code does not execute for extraneous reasons
- replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_parallel_pairwise.py clean of pl - code executes properly
- replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_ward.py clean of pl - code executes properly
- replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_sgd_regression.py clean of pl - code executes properly
- replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_tree.py clean of pl - code executes properly
- replaced with matplotlib.pyplot - pl --> plt
- replaced with matplotlib.pyplot - pl --> plt
- replaced with matplotlib.pyplot - pl --> plt
|
|
||
| >>> import pylab as pl # doctest: +SKIP | ||
| >>> pl.figure() # doctest: +SKIP | ||
| >>> import matplotlib as plt # doctest: +SKIP |
Member
|
Thanks @ztultrebor. Are you done with this PR? If so please change the title from [WIP] to [MRG]. +1 for merge on my side once #6762 (comment) is taken care of. |
Contributor
Author
|
I've still got a few more files to clean up. Once those are taken care of I'll be certain to update the pull title appropriately |
- replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - mlcomp_sparse_document_classification.py clean of pl
- replace instances of pl (as on import pylab as pl)
with plt (as in import matplotlib.pyplot as plt)
- plot_gpr_noisy_targets.py clean of pl
- code does not execute for extraneous reasons
- File "examples/gaussian_process/plot_gpr_noisy_targets.py", line 31, in
<module>
- from sklearn.gaussian_process import GaussianProcessRegressor
- ImportError: cannot import name GaussianProcessRegressor
- replace instances of pl (as on import pylab as pl)
with plt (as in import matplotlib.pyplot as plt)
- plot_gpc_isoprobability.py clean of pl
- code does not execute for extraneous reasons
- File "examples/gaussian_process/plot_gpc_isoprobability.py", line 24, in
<module>
- from sklearn.gaussian_process import GaussianProcessClassifier
- ImportError: cannot import name GaussianProcessClassifier
- replaced with matplotlib.pyplot - pl --> plt
- replaced with matplotlib.pyplot
- replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - plot_sparse_coding.py clean of pl - code executes properly
- replaced with matplotlib.pyplot
- replaced with matplotlib.pyplot
benchmarks/bench_plot_neighbors.py
Outdated
|
|
||
| c_bar = pl.bar(xvals, build_time[alg] - bottom, | ||
| c_bar = plt.bar(xvals, build_time[alg] - bottom, | ||
| width, bottom, color='r') |
Member
There was a problem hiding this comment.
you need to change the indentation here and there, since you added a character
Member
|
Thank you @ztultrebor ! |
olologin
pushed a commit
to olologin/scikit-learn
that referenced
this pull request
Aug 24, 2016
…cikit-learn#6762) * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - one instance of 22 occurrences of pylab replaced with matplotlib.pyplot - bench_glm.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - one instance of 21 remaining occurrences of pylab replaced with matplotlib.pyplot - bench_glmnet.py now free of pylab references - code does not execute for extraneous reason: ImportError: No module named glmnet.elastic_net * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - one instance of 19 occurrences of pylab replaced with matplotlib.pyplot - bench_lasso.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - one instance of 18 occurrences of pylab replaced with matplotlib.pyplot - bench_plot_neighbors.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - one instance of 17 occurrences of pylab replaced with matplotlib.pyplot - bench_plot_omp_lars.py now free of pylab references - code does not execute for extraneous reasons: - File "bench_plot_omp_lars.py", line 111, in <module> - ax = fig.add_subplot(1, 2, i) - ValueError: num must be 1 <= num <= 2, not 0 - line 111 should probably be ax = fig.add_subplot(1, 2, i+1) * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - bench_plot_parallel_pairwise.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - bench_plot_ward.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - bench_sgd_regression.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - bench_tree.py now free of pylab references - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_glm.py clean * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_glm.py clean of pl - code does not execute for extraneous reasons * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_lasso.py clean of pl - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_neighbors.py clean of pl - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_omp_lars.py clean of pl - code does not execute for extraneous reasons * fix: Fix bug that prevented graphs from displaying * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_parallel_pairwise.py clean of pl - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_ward.py clean of pl - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_sgd_regression.py clean of pl - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_tree.py clean of pl - code executes properly * docs: removed pylab references from comments * docs: removed all pylab references - replaced with matplotlib.pyplot - pl --> plt * docs: removed pylab references from comments - replaced with matplotlib.pyplot - pl --> plt * docs: removed all pylab references - replaced with matplotlib.pyplot - pl --> plt * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - mlcomp_sparse_document_classification.py clean of pl * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - plot_gpr_noisy_targets.py clean of pl - code does not execute for extraneous reasons - File "examples/gaussian_process/plot_gpr_noisy_targets.py", line 31, in <module> - from sklearn.gaussian_process import GaussianProcessRegressor - ImportError: cannot import name GaussianProcessRegressor * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - plot_gpc_isoprobability.py clean of pl - code does not execute for extraneous reasons - File "examples/gaussian_process/plot_gpc_isoprobability.py", line 24, in <module> - from sklearn.gaussian_process import GaussianProcessClassifier - ImportError: cannot import name GaussianProcessClassifier * docs: removed all pylab references - replaced with matplotlib.pyplot - pl --> plt * docs: removed all pylab references - replaced with matplotlib.pyplot * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - plot_sparse_coding.py clean of pl - code executes properly * docs: removed all pylab references - replaced with matplotlib.pyplot * docs: removed all pylab references - replaced with matplotlib.pyplot * style: Indent properly * style: indent properly * style: Indent properly * docs: Add missing .pyplot * docs: Fix typo * style: Indent properly
TomDLT
pushed a commit
to TomDLT/scikit-learn
that referenced
this pull request
Oct 3, 2016
…cikit-learn#6762) * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - one instance of 22 occurrences of pylab replaced with matplotlib.pyplot - bench_glm.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - one instance of 21 remaining occurrences of pylab replaced with matplotlib.pyplot - bench_glmnet.py now free of pylab references - code does not execute for extraneous reason: ImportError: No module named glmnet.elastic_net * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - one instance of 19 occurrences of pylab replaced with matplotlib.pyplot - bench_lasso.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - one instance of 18 occurrences of pylab replaced with matplotlib.pyplot - bench_plot_neighbors.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - one instance of 17 occurrences of pylab replaced with matplotlib.pyplot - bench_plot_omp_lars.py now free of pylab references - code does not execute for extraneous reasons: - File "bench_plot_omp_lars.py", line 111, in <module> - ax = fig.add_subplot(1, 2, i) - ValueError: num must be 1 <= num <= 2, not 0 - line 111 should probably be ax = fig.add_subplot(1, 2, i+1) * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - bench_plot_parallel_pairwise.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - bench_plot_ward.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - bench_sgd_regression.py now free of pylab references - code executes properly * Fix: Replace pylab with matplotlib.pyplot scikit-learn#6754 - bench_tree.py now free of pylab references - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_glm.py clean * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_glm.py clean of pl - code does not execute for extraneous reasons * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_lasso.py clean of pl - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_neighbors.py clean of pl - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_omp_lars.py clean of pl - code does not execute for extraneous reasons * fix: Fix bug that prevented graphs from displaying * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_parallel_pairwise.py clean of pl - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_plot_ward.py clean of pl - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_sgd_regression.py clean of pl - code executes properly * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - bench_tree.py clean of pl - code executes properly * docs: removed pylab references from comments * docs: removed all pylab references - replaced with matplotlib.pyplot - pl --> plt * docs: removed pylab references from comments - replaced with matplotlib.pyplot - pl --> plt * docs: removed all pylab references - replaced with matplotlib.pyplot - pl --> plt * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - mlcomp_sparse_document_classification.py clean of pl * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - plot_gpr_noisy_targets.py clean of pl - code does not execute for extraneous reasons - File "examples/gaussian_process/plot_gpr_noisy_targets.py", line 31, in <module> - from sklearn.gaussian_process import GaussianProcessRegressor - ImportError: cannot import name GaussianProcessRegressor * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - plot_gpc_isoprobability.py clean of pl - code does not execute for extraneous reasons - File "examples/gaussian_process/plot_gpc_isoprobability.py", line 24, in <module> - from sklearn.gaussian_process import GaussianProcessClassifier - ImportError: cannot import name GaussianProcessClassifier * docs: removed all pylab references - replaced with matplotlib.pyplot - pl --> plt * docs: removed all pylab references - replaced with matplotlib.pyplot * refactor: Replace pl with plt - replace instances of pl (as on import pylab as pl) with plt (as in import matplotlib.pyplot as plt) - plot_sparse_coding.py clean of pl - code executes properly * docs: removed all pylab references - replaced with matplotlib.pyplot * docs: removed all pylab references - replaced with matplotlib.pyplot * style: Indent properly * style: indent properly * style: Indent properly * docs: Add missing .pyplot * docs: Fix typo * style: Indent properly
trevorstephens
added a commit
to trevorstephens/scikit-learn
that referenced
this pull request
Jul 26, 2017
trevorstephens
added a commit
to trevorstephens/scikit-learn
that referenced
this pull request
Aug 12, 2017
trevorstephens
added a commit
to trevorstephens/scikit-learn
that referenced
this pull request
May 25, 2018
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.
#6754
Reference Issue
What does this implement/fix? Explain your changes.
with plt (as in import matplotlib.pyplot as plt)
Any other comments?