How to specify location and arrangement of nodes?

37 views
Skip to first unread message

Klaus

unread,
Jan 1, 2014, 4:13:22 AM1/1/14
to py...@googlegroups.com
Hello,

I have a set of nodes. When plotting them, they are usually arranged horizontally.
However, when I add edges between the nodes, then the nodes are arranged in some way to optimize the plotting of the edges.

Is it possible to define that the nodes should be still arranged horizontally even if I add edges between the nodes?

Another question is if it's possible to define for one node that this node should be plotted in a special region, for instance in the upper right corner?

Thanks,
 Klaus

Ero Carrera

unread,
Jan 1, 2014, 6:28:14 PM1/1/14
to py...@googlegroups.com
Hi Klaus,

The position of a node can be specified as described in the following
StackOverflow question:

http://stackoverflow.com/questions/5343899/how-to-force-node-position-x-and-y-in-graphviz

Using "rank" and "rankdir" you will be able to control the arrangement
of groups of nodes. There are some examples here:

http://graphs.grevian.org/example.html

pydot can be used to set any of those attributes. I hope those
resources are helpful.

Best regards and happy new year!
--
Ero
> --
> You received this message because you are subscribed to the Google Groups
> "pydot" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pydot+un...@googlegroups.com.
> To post to this group, send email to py...@googlegroups.com.
> Visit this group at http://groups.google.com/group/pydot.
> For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages