Thanks Jason,

But the color assigned is random. I wonder if it is possible to assign
it systematically (like image in matplotlib) and possibly with a
colorbar.

Rajeev


On Apr 27, 7:28 pm, Jason Grout <[email protected]> wrote:
> On 04/27/2010 07:32 AM, Rajeev wrote:
>
> > Hi,
>
> > I want to plot weighted graphs such that the link-width or color may
> > have the information of relative weights. Please point the relevant
> > document page. I couldn't find one.
>
> Does this work?
>
> sage: g=DiGraph(random_matrix(ZZ,5))
> sage: g.weighted_adjacency_matrix()
> [  1   1  -1   2  -1]
> [  1   3 -38  -3   4]
> [ -2  -1  -1  -1  -1]
> [  1  -1  -1   1   5]
> [ -1   2  -2  -3  -7]
> sage: plot(g, color_by_label=True)
>
> Seehttp://www.sagemath.org/doc/reference/sage/graphs/generic_graph.html#...
>
> Thanks,
>
> Jason
>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to 
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/sage-support
> URL:http://www.sagemath.org

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to