10000 MNT FIX plt.cm.spectral -> plt.cm.nipy_spectral in 0.19.X branch by ogrisel · Pull Request #11442 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

MNT FIX plt.cm.spectral -> plt.cm.nipy_spectral in 0.19.X branch #11442

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/applications/plot_stock_market.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_agglomerative_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_digits_agglomeration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_digits_linkage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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([])
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_face_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_face_ward_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions examples/cluster/plot_kmeans_silhouette_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_kmeans_stability_low_dim_dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion examples/decomposition/plot_pca_iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -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([])
Expand Down
0