Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

graphviz nodes of different colors

Tags:

graphviz

I am trying to create a directed graph with nodes of different filled colors. I have created a gv file like this:

digraph mentions {
  "A" -> "B"
  "A" -> "C"
  "B" -> "C"
  "B" -> "A"
  "A" [shape=circle, style=filled, fillcolor=red]
  "B" [shape=circle, style=filled, fillcolor=green]
  "C" [shape=circle, style=filled, fillcolor=purple]
}

And my command line argument is:

ccomps -zX#0-1000 testGraphCalls.gv | \
grep "-" | cat <(echo "digraph mentions {") - <(echo "}") | \
sfdp -Gbgcolor=white -Ecolor=blue \
-Nwidth=1 -Nheight=1 -Nfixedsize=true \
-Nlabel='' -Earrowsize=0.4 -Gsize=75 -Gratio=fill \
-Tpng > test.png

However, the nodes of my white circles outlined in black. Any ideas of how I can get the nodes to fill properly?

like image 605
user1253952 Avatar asked Oct 28 '12 04:10

user1253952


People also ask

How do you order nodes in Graphviz?

If ordering="out" , then the outedges of a node, that is, edges with the node as its tail node, must appear left-to-right in the same order in which they are defined in the input. If ordering="in" , then the inedges of a node must appear left-to-right in the same order in which they are defined in the input.

What is rank in Graphviz?

Ranks and Subgraphs To work out the layout, Graphviz uses a system it calls "ranks". Each node is assigned a higher rank than the highest ranked node that point to it. If your rank direction is set to left to right ( rankdir=LR ), then nodes with a higher rank are placed further to the right.

How do I use DOT in Graphviz?

How do I use graphviz to convert this into an image? For windows: dl the msi and install; Find gvedit.exe in your programs list; Open . dot file in question; Click running person on toolbar; Go to graph -> settings ; change Output file type to file type of your liking and press ok..


1 Answers

What is all the stuff in your command? When you grep for "-" in your .dv file, grep won't print the three attribute lines.

Do you have the program dot, which you could use for a quick test of your graph file?

like image 197
joe Avatar answered Oct 13 '22 10:10

joe