draw_graph options



It is possible to do this directly with draw_graph. However you can use data
from graphs and draw graphs with the draw2d function. This gives you all of
the options of the draw package.

Here is an example which draws the 5-faces of the buckyball in green and the
bounded 6-faces in blue.

load(graphs)$

c60: truncated_icosahedron_graph()$
faces: planar_embedding(c60)$
faces_5: sublist(faces, lambda([f], is(length(f)=5)))$
faces_6: sublist(faces, lambda([f], is(length(f)=6)))$

draw_graph(c60, program=planar_embedding)$
pos: get_positions(c60)$
draw2d(
    fill_color=yellow,
    map(lambda([f], polygon(map(lambda([v], assoc(v, pos)), f))), faces_6),
    fill_color=blue,
    map(lambda([f], polygon(map(lambda([v], assoc(v, pos)), f))), faces_5),
    draw_graph(c60, edge_width=2, vertex_size=0, transform=true))$

This works with maxima from cvs. On an older version you will probably need
to replace draw_graph(...,transform=true) with graph(...).

HTH, Andrej


On Tue, Jul 20, 2010 at 1:27 PM, Marco Rofei <marco.rofei at gmail.com> wrote:

>  Hi everyone, I hope someone could help me.
>
> I have an adjacency_matrix (A) and I need to graph the line_graph of (A). I
> use commands as follows
>
> A : ([0000111],[...], ... ,[...])
> a:from_adjacency_matrix(A)
> draw_graph(line_graph(a), programs=planar_embedding)
>
> All works fine, but i need to colorize the multiple members. If I want to
> draw the graph of (a) i have a certain number of edges and vertex. One of
> those vertex has (for instance) multiplicity *n* meaning that n edges
> converge in it. When i plot the line_graph of (a) the n-multiplicity vertex
> of graph become a polygon with *n* sides.
> Is there the possibility to fill or hatch these polygons with any option in
> draw_graph function?
>
> PS: sorry for my awful English [image: :)]
>
> MR
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>