3

Ordinarily I draw graphs in tikz with:

\begin{tikzpicture}
    \Vertex[x=1,y=1]{x1}
    \Vertex[x=2,y=1]{x2}
    \Vertex[x=3,y=1]{x3}
    \Vertex[x=4,y=1]{x4}
    \Vertex[x=5,y=1]{x5}
    \Edge(x1)(x2)
    \Edge(x2)(x3)
    \Edge(x3)(x4)
    \Edge(x4)(x5)
\end{tikzpicture}

Now I want to draw a factor graph, where the vertices are squares instead of circles. This is the only difference.

I can't, however, find out how. How do I?

Qrrbrbirlbel
  • 119,821
Andrew Latham
  • 283
  • 1
  • 3
  • 8
  • I'm not able to provide an answer. Anyway, take a look at this library: https://github.com/jluttine/tikz-bayesnet – jackb Nov 19 '18 at 03:08

1 Answers1

1
\tikzset{VertexStyle/.style = {shape = rectangle,fill = gray}}
Andrew Latham
  • 283
  • 1
  • 3
  • 8