diff --git a/examples/applications/plot_stock_market.py b/examples/applications/plot_stock_market.py index a79b4975e4642..f7887f1f14471 100644 --- a/examples/applications/plot_stock_market.py +++ b/examples/applications/plot_stock_market.py @@ -278,7 +278,7 @@ def quotes_historical_google(symbol, start_date, end_date): # Plot the nodes using the coordinates of our embedding plt.scatter(embedding[0], embedding[1], s=100 * d ** 2, c=labels, - cmap=plt.cm.spectral) + cmap=plt.cm.nipy_spectral) # Plot the edges start_idx, end_idx = np.where(non_zero) @@ -321,7 +321,7 @@ def quotes_historical_google(symbol, start_date, end_date): horizontalalignment=horizontalalignment, verticalalignment=verticalalignment, bbox=dict(facecolor='w', - edgecolor=plt.cm.spectral(label / float(n_labels)), + edgecolor=plt.cm.nipy_spectral(label / float(n_labels)), alpha=.6)) plt.xlim(embedding[0].min() - .15 * embedding[0].ptp(), diff --git a/examples/cluster/plot_agglomerative_clustering.py b/examples/cluster/plot_agglomerative_clustering.py index dfb27d17d1a89..1cc08a1ddcc63 100644 --- a/examples/cluster/plot_agglomerative_clustering.py +++ b/examples/cluster/plot_agglomerative_clustering.py @@ -61,7 +61,7 @@ model.fit(X) elapsed_time = time.time() - t0 plt.scatter(X[:, 0], X[:, 1], c=model.labels_, - cmap=plt.cm.spectral) + cmap=plt.cm.nipy_spectral) plt.title('linkage=%s (time %.2fs)' % (linkage, elapsed_time), fontdict=dict(verticalalignment='top')) plt.axis('equal') diff --git a/examples/cluster/plot_digits_agglomeration.py b/examples/cluster/plot_digits_agglomeration.py index 31d8094e1cf2d..ce8bd8daf3bf0 100644 --- a/examples/cluster/plot_digits_agglomeration.py +++ b/examples/cluster/plot_digits_agglomeration.py @@ -54,7 +54,7 @@ plt.subplot(3, 4, 10) plt.imshow(np.reshape(agglo.labels_, images[0].shape), - interpolation='nearest', cmap=plt.cm.spectral) + interpolation='nearest', cmap=plt.cm.nipy_spectral) plt.xticks(()) plt.yticks(()) plt.title('Labels') diff --git a/examples/cluster/plot_digits_linkage.py b/examples/cluster/plot_digits_linkage.py index f1fe1783c10e5..d1f50c4d92861 100644 --- a/examples/cluster/plot_digits_linkage.py +++ b/examples/cluster/plot_digits_linkage.py @@ -61,7 +61,7 @@ def plot_clustering(X_red, X, labels, title=None): plt.figure(figsize=(6, 4)) for i in range(X_red.shape[0]): plt.text(X_red[i, 0], X_red[i, 1], str(y[i]), - color=plt.cm.spectral(labels[i] / 10.), + color=plt.cm.nipy_spectral(labels[i] / 10.), fontdict={'weight': 'bold', 'size': 9}) plt.xticks([]) diff --git a/examples/cluster/plot_face_segmentation.py b/examples/cluster/plot_face_segmentation.py index 12b7318b7e338..151b0131c76e5 100644 --- a/examples/cluster/plot_face_segmentation.py +++ b/examples/cluster/plot_face_segmentation.py @@ -71,7 +71,7 @@ plt.imshow(face, cmap=plt.cm.gray) for l in range(N_REGIONS): plt.contour(labels == l, contours=1, - colors=[plt.cm.spectral(l / float(N_REGIONS))]) + colors=[plt.cm.nipy_spectral(l / float(N_REGIONS))]) plt.xticks(()) plt.yticks(()) title = 'Spectral clustering: %s, %.2fs' % (assign_labels, (t1 - t0)) diff --git a/examples/cluster/plot_face_ward_segmentation.py b/examples/cluster/plot_face_ward_segmentation.py index 1490b6a110388..476c060217f32 100644 --- a/examples/cluster/plot_face_ward_segmentation.py +++ b/examples/cluster/plot_face_ward_segmentation.py @@ -61,7 +61,7 @@ plt.imshow(face, cmap=plt.cm.gray) for l in range(n_clusters): plt.contour(label == l, contours=1, - colors=[plt.cm.spectral(l / float(n_clusters)), ]) + colors=[plt.cm.nipy_spectral(l / float(n_clusters)), ]) plt.xticks(()) plt.yticks(()) plt.show() diff --git a/examples/cluster/plot_kmeans_silhouette_analysis.py b/examples/cluster/plot_kmeans_silhouette_analysis.py index ac36bc1fe72e5..be622eeda65a4 100644 --- a/examples/cluster/plot_kmeans_silhouette_analysis.py +++ b/examples/cluster/plot_kmeans_silhouette_analysis.py @@ -95,7 +95,7 @@ size_cluster_i = ith_cluster_silhouette_values.shape[0] y_upper = y_lower + size_cluster_i - color = cm.spectral(float(i) / n_clusters) + color = cm.nipy_spectral(float(i) / n_clusters) ax1.fill_betweenx(np.arange(y_lower, y_upper), 0, ith_cluster_silhouette_values, facecolor=color, edgecolor=color, alpha=0.7) @@ -117,7 +117,7 @@ ax1.set_xticks([-0.1, 0, 0.2, 0.4, 0.6, 0.8, 1]) # 2nd Plot showing the actual clusters formed - colors = cm.spectral(cluster_labels.astype(float) / n_clusters) + colors = cm.nipy_spectral(cluster_labels.astype(float) / n_clusters) ax2.scatter(X[:, 0], X[:, 1], marker='.', s=30, lw=0, alpha=0.7, c=colors, edgecolor='k') diff --git a/examples/cluster/plot_kmeans_stability_low_dim_dense.py b/examples/cluster/plot_kmeans_stability_low_dim_dense.py index ef8562cfd84a7..c628c6c38b3c0 100644 --- a/examples/cluster/plot_kmeans_stability_low_dim_dense.py +++ b/examples/cluster/plot_kmeans_stability_low_dim_dense.py @@ -108,7 +108,7 @@ def make_data(random_state, n_samples_per_center, grid_size, scale): fig = plt.figure() for k in range(n_clusters): my_members = km.labels_ == k - color = cm.spectral(float(k) / n_clusters, 1) + color = cm.nipy_spectral(float(k) / n_clusters, 1) plt.plot(X[my_members, 0], X[my_members, 1], 'o', marker='.', c=color) cluster_center = km.cluster_centers_[k] plt.plot(cluster_center[0], cluster_center[1], 'o', diff --git a/examples/decomposition/plot_pca_iris.py b/examples/decomposition/plot_pca_iris.py index 23bf4ce510135..a4678da955d89 100644 --- a/examples/decomposition/plot_pca_iris.py +++ b/examples/decomposition/plot_pca_iris.py @@ -50,7 +50,7 @@ bbox=dict(alpha=.5, edgecolor='w', facecolor='w')) # Reorder the labels to have colors matching the cluster results y = np.choose(y, [1, 2, 0]).astype(np.float) -ax.scatter(X[:, 0], X[:, 1], X[:, 2], c=y, cmap=plt.cm.spectral, +ax.scatter(X[:, 0], X[:, 1], X[:, 2], c=y, cmap=plt.cm.nipy_spectral, edgecolor='k') ax.w_xaxis.set_ticklabels([])