From 38d8e9f5f2c0568a9933c0bfaf2902dd8a059f5e Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Sat, 29 Aug 2015 09:13:07 +0200 Subject: [PATCH] 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)