8

I'm trying to draw some graph using graphviz with dot. It works fine. However, I would like to set the font to italic for letters (a,b,c...). Here is my code:

digraph mygraph{
  node [shape=plaintext]
 "Ø" -> "{a}" 
 "Ø" -> "{b}" 
 "Ø" -> "{c}"
 "Ø" -> "{d}"
}

What should I do so that 'a' 'b' 'c' and 'd' would be in italics but not the '{' and '}'?

Evan Carslake
  • 2,267
  • 15
  • 38
  • 56
Phil
  • 3,375
  • 3
  • 30
  • 46

1 Answers1

12

You may try using the syntax for Html-like labels and first define the node a with a label attribute:

a [label=<{<I>a</I>}>]
"Ø" -> a
marapet
  • 54,856
  • 12
  • 170
  • 184
  • Thanks but by doing this, the {a} is shown as an edge label rather than a node label. I want the node label to be in italics – Phil Jun 29 '15 at 23:54
  • You're right of course, I fixed the example - you'll have to first define the node with its attributes, and then define the edges. – marapet Jun 30 '15 at 07:08
  • When used in this way with `shape = circle`, the circle becomes an ellipse, and the double circle does not appear. This code: `q0 [label=<q0>]`, `node [shape = doublecircle]; q0;`, `node [shape = circle]; qi -> q0; q0 -> q0 [ label = "b" ];` does paint ellipses. Why is it so? – nightcod3r Dec 06 '17 at 22:36