Search code examples
graphvizdotitalics

How to do italic node labels with GraphViz dot?


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 '}'?


Solution

  • 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