[graph-tool] Color scale

Tiago de Paula Peixoto tiago at skewed.de
Thu Mar 6 00:57:49 CET 2014


On 03/06/2014 12:43 AM, Xiaohu Hu wrote:
> Hi,
>
> I would like to color my vertices based on their degree, the default
> color scheme give me a sort of from "warm to cold" coloring. How can I
> specify the color scale myself, i.e. using grey scale or from red to
> blue etc.

The graph_draw() function takes a 'vcmap' parameter which specifies the
colormap which should be used for the vertices. You can choose any
matplotlib colormap you want, or define your own:

    http://matplotlib.org/examples/color/colormaps_reference.html

You can also specify the colors yourself via a property map with either
a string color code, or a vector with RGBA values.

Best,
Tiago

-- 
Tiago de Paula Peixoto <tiago at skewed.de>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <https://lists.skewed.de/pipermail/graph-tool/attachments/20140306/07ec9268/attachment.asc>


More information about the graph-tool mailing list