Search code examples
graphviz

graphviz nodes of different colors


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?


Solution

  • 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?