From 3f7ce2e670b1be9c9f79ed8c7b51172c682c46b1 Mon Sep 17 00:00:00 2001 From: Vighnesh Birodkar Date: Fri, 15 Aug 2014 21:28:47 +0530 Subject: [PATCH] Added example with cubehelix --- doc/examples/plot_rag_draw.py | 7 +++++++ skimage/graph/rag.py | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/examples/plot_rag_draw.py b/doc/examples/plot_rag_draw.py index 2572a3fb..abf2ba08 100644 --- a/doc/examples/plot_rag_draw.py +++ b/doc/examples/plot_rag_draw.py @@ -27,6 +27,13 @@ out = graph.draw_rag(labels, g, img, node_color="#ffde00", colormap=cmap, plt.figure() plt.title("RAG with edge weights less than 30, color " "mapped between blue and orange.") +plt.imshow(out) + +plt.figure() +plt.title("All edges drawn with cubehelix colormap") +cmap = plt.get_cmap('cubehelix') +out = graph.draw_rag(labels, g, img, colormap=cmap, + desaturate=True) plt.imshow(out) plt.show() diff --git a/skimage/graph/rag.py b/skimage/graph/rag.py index edd9ecde..edaec4b3 100644 --- a/skimage/graph/rag.py +++ b/skimage/graph/rag.py @@ -251,8 +251,8 @@ def draw_rag(labels, rag, img, border_color=None, node_color='#ffff00', """Draw a Region Adjacency Graph on an image. Given a labelled image and its corresponding RAG, draw the nodes and edges - of the RAG on the image with the specified colors. Nodes are markes by - the centroids of the corresposning regions. + of the RAG on the image with the specified colors. Nodes are marked by + the centroids of the corresponding regions. Parameters ---------- @@ -276,7 +276,7 @@ def draw_rag(labels, rag, img, border_color=None, node_color='#ffff00', mapping. desaturate : bool, optional Convert the image to grayscale before displaying. Particularly helps - visualiztion when using the `colormap` option. + visualization when using the `colormap` option. in_place : bool, optional If set, the RAG is modified in place. For each node `n` the function will set a new attribute ``rag.node[n]['centroid']``.