From 2a6e7ffdfcaa916557da2e65ad23d3789d430dbd Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Fri, 28 Aug 2015 22:17:21 +0200 Subject: [PATCH 1/2] Replace cubehelix with the viridis colormap in the RAG drawing example --- doc/examples/plot_rag_draw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/examples/plot_rag_draw.py b/doc/examples/plot_rag_draw.py index bdc39678..bc56b09f 100644 --- a/doc/examples/plot_rag_draw.py +++ b/doc/examples/plot_rag_draw.py @@ -31,8 +31,8 @@ plt.title("RAG with edge weights less than 30, color " plt.imshow(out) plt.figure() -plt.title("All edges drawn with cubehelix colormap") -cmap = plt.get_cmap('cubehelix') +plt.title("All edges drawn with viridis colormap") +cmap = plt.get_cmap('viridis') out = graph.draw_rag(labels, g, img, colormap=cmap, desaturate=True) From 38d8e9f5f2c0568a9933c0bfaf2902dd8a059f5e Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Sat, 29 Aug 2015 09:13:07 +0200 Subject: [PATCH 2/2] Import viridis from skimage.util.colormap. viridis is not yet available in a released matplotlib. For now, use the one in skimage. --- doc/examples/plot_rag_draw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/examples/plot_rag_draw.py b/doc/examples/plot_rag_draw.py index bc56b09f..1e8a18f9 100644 --- a/doc/examples/plot_rag_draw.py +++ b/doc/examples/plot_rag_draw.py @@ -8,6 +8,7 @@ the `rag_draw` method. """ from skimage import data, segmentation from skimage.future import graph +from skimage.util.colormap import viridis from matplotlib import pyplot as plt, colors @@ -32,8 +33,7 @@ plt.imshow(out) plt.figure() plt.title("All edges drawn with viridis colormap") -cmap = plt.get_cmap('viridis') -out = graph.draw_rag(labels, g, img, colormap=cmap, +out = graph.draw_rag(labels, g, img, colormap=viridis, desaturate=True) plt.imshow(out)