From 0d6d377cbc61d7bf484f0042ed844386432c1883 Mon Sep 17 00:00:00 2001 From: Fabian Pedregosa <fabian.pedregosa@inria.fr> Date: Mon, 28 Feb 2011 12:40:30 +0100 Subject: [PATCH] Examples cleanup: remove pl.close, it is now handled by gen_rst. --- examples/plot_covariance_estimation.py | 1 - examples/plot_ica_vs_pca.py | 1 - examples/plot_permutation_test_for_classification.py | 9 ++++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/plot_covariance_estimation.py b/examples/plot_covariance_estimation.py index 2e0954957e..217397e22d 100644 --- a/examples/plot_covariance_estimation.py +++ b/examples/plot_covariance_estimation.py @@ -40,7 +40,6 @@ negative_logliks = [-cov.fit(X_train, shrinkage=s).score(X_test) \ ############################################################################### # Plot results -pl.close('all') pl.loglog(shrinkages, negative_logliks) pl.xlabel('Shrinkage') pl.ylabel('Negative log-likelihood') diff --git a/examples/plot_ica_vs_pca.py b/examples/plot_ica_vs_pca.py index 76509a3cfa..4787cecda4 100644 --- a/examples/plot_ica_vs_pca.py +++ b/examples/plot_ica_vs_pca.py @@ -77,7 +77,6 @@ def plot_samples(S, axis_list=None): pl.xlabel('$x$') pl.ylabel('$y$') -pl.close('all') pl.subplot(2, 2, 1) plot_samples(S / S.std()) pl.title('True Independant Sources') diff --git a/examples/plot_permutation_test_for_classification.py b/examples/plot_permutation_test_for_classification.py index 7f66b98e27..d41eb0c3c7 100644 --- a/examples/plot_permutation_test_for_classification.py +++ b/examples/plot_permutation_test_for_classification.py @@ -17,6 +17,7 @@ obtained in the first place. print __doc__ import numpy as np +import pylab as pl from scikits.learn.svm import SVC from scikits.learn.cross_val import StratifiedKFold, permutation_test_score @@ -49,15 +50,13 @@ print "Classification score %s (pvalue : %s)" % (score, pvalue) ############################################################################### # View histogram of permutation scores -import pylab as pl -pl.close('all') pl.hist(permutation_scores, label='Permutation scores') ylim = pl.ylim() pl.vlines(score, ylim[0], ylim[1], linestyle='--', - color='g', linewidth=3, label='Classification Score' - ' (pvalue %s)' % pvalue) + color='g', linewidth=3, label='Classification Score' + ' (pvalue %s)' % pvalue) pl.vlines(1.0 / n_classes, ylim[0], ylim[1], linestyle='--', - color='k', linewidth=3, label='Luck') + color='k', linewidth=3, label='Luck') pl.ylim(ylim) pl.legend() pl.xlabel('Score') -- GitLab