Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use \" in a label in GraphViz using Dot?

I'm using dot - graphviz version 2.26.3 (20100126.1600)

I want to have a node with the following label (including the \ ):

text here \"\" more text

I have tried replaced \" with \", \\", The problem is GraphViz interprets \" as "; no matter what.

How can I output \"\" in a label?

like image 868
Brian Avatar asked Oct 21 '25 03:10

Brian


1 Answers

digraph Quote{
node [shape="record", style="rounded"];
edge [style="dashed"];

Explain [label="<0>\\| <1>\\| <2>\\| <3>\"|<res> result"];
n0 [label="backslash to escape next backslash"];
n1 [label="backslash"];
n2 [label="backslash to escape next quote"];
n3 [label="quote"];
n4 [label="\\\""];

Explain:0 -> n0;
Explain:1 -> n1;
Explain:2 -> n2;
Explain:3 -> n3;
Explain:res -> n4;
}

enter image description here

like image 74
bigeast Avatar answered Oct 22 '25 16:10

bigeast



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!