Using character font / mathematical notation in graphics

[Environment: graphviz 2.38 / Windows 7]

Using dot , I want to create path diagrams like the following to represent a model of a structural equation (well, well, just a simple one-factor measurement model). I would like to use Greek letters for some nodes and edges, and actually would prefer if I could use LaTeX-like notation in a dot file, for example \ksi , \lambda_1 or \delta_1

threevar

This diagram should be three equations

 \begin{eqnarray*} x_{1i} & = & \lambda_1 \xi_{i} + \delta_{1i} \\ x_{2i} & = & \lambda_2 \xi_{i} + \delta_{2i} \\ x_{3i} & = & \lambda_3 \xi_{i} + \delta_{3i} \end{eqnarray*} 

The closest I came to is the following .dot kludge file, where I selected font = "Symbol" and replaced the Greek letters with my Roman equivalents.

However, this does not work with dot -Tpdf or AFAICS devices other than Postscript dot -Tps , giving me the .eps file that I need to convert to PDF or PNG.

Question: is there anything better for this situation?

 digraph threevar { rankdir=LR; size="8,4"; node [fontname="Helvetica" fontsize=14 shape=box]; edge [fontname="Symbol" fontsize=10]; center=1; {rank=min k } {rank=same X1 X2 X3 } {rank=max z1 z2 z3 } z1 [shape=circle fontname="Symbol" label="d1"]; z2 [shape=circle fontname="Symbol" label="d2"]; z3 [shape=circle fontname="Symbol" label="d3"]; k [fontname="Symbol" label="x" shape="ellipse"]; k -> X1 [label="l1"]; k -> X2 [label="l2"]; k -> X3 [label="l3"]; z1 -> X1; z2 -> X2; z3 -> X3; } 
+5
source share
1 answer

OK, using UTF8 characters directly in the .dot file, now I can avoid the Symbol font skin (but what I tried for indexes, for example, index-one, x2081 has a small box containing "2081")

Here's a revised file that now works with both -Tpdf and -Tpng . (UTF8 characters are not displayed properly in this message.)

  digraph threevar { rankdir=LR; size="8,4"; node [fontsize=14 shape=box]; edge [fontsize=10]; center=1; {rank=min k } {rank=same X1 X2 X3 } {rank=max z1 z2 z3 } z1 [shape=circle label="d1"]; z2 [shape=circle label="d2"]; z3 [shape=circle label="d3"]; k [label="?" shape="ellipse"]; k -> X1 [label="?1"]; k -> X2 [label="?2"]; k -> X3 [label="?3"]; z1 -> X1; z2 -> X2; z3 -> X3; } 

Result:

enter image description here

+3
source

All Articles