6

I want to show Double quotes and Parentheses in nodes.

Without using A[label="Rahul(A)"]. I want to show during Rahul(A) -> B

vikas27
  • 563
  • 5
  • 14
  • 36

1 Answers1

12

The only way I know to do that (without label) is by enclosing the node name between double quotes, and escaping double quotes which are part of the node name:

This works:

"Rahul(A)" -> "Rahul \"B\"";

graphviz output

marapet
  • 54,856
  • 12
  • 170
  • 184
  • In java it is not coming like that. This is what i am doing :- Graphviz gv = new Graphviz(); gv.addln(gv.start_graph()); gv.addln("A(SS) -> B;"); gv.addln("D -> C \"YY\";"); I dont know y it is not working – vikas27 Oct 12 '11 at 16:37
  • 1
    If you use a special implementation/library, you should mention that in your question. Otherwise it's assumed you use the original graphviz implementation available on graphviz.org. This being said, you'd of course have to escape special characters one more time for java: `gv.addln("\"A(SS)\" -> B;")` for example. – marapet Oct 12 '11 at 20:47