Added example with cubehelix

This commit is contained in:
Vighnesh Birodkar
2014-08-15 21:28:47 +05:30
parent 344e2a51c0
commit 3f7ce2e670
2 changed files with 10 additions and 3 deletions
+7
View File
@@ -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()
+3 -3
View File
@@ -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']``.