mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-06 05:16:40 +08:00
Import viridis from skimage.util.colormap.
viridis is not yet available in a released matplotlib. For now, use the one in skimage.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user