3

I would like to have a curly bracket below a few nodes as given in image. I tried to follow this example, but I could not understand it.

Thanks

\documentclass[11pt]{report}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{bayesnet}
\begin{document}

\begin{figure}
    \centering
    \tikz{ %
        \node[latent]                       (phi)   {$\phi$};
        \node[latent,   above = of phi]     (y)     {$y$};
        \node[obs,      left = of y]        (Obs_y) {$ \tilde {\bf{y}}$};
        \node[latent,   below = of Obs_y]   (sigma) {$\sigma_y$};
        \edge {phi} {y};
        \edge {y, sigma} {Obs_y};
}
\end{figure}
\end{document}

enter image description here

Andrew Swann
  • 95,762
pkj
  • 511

1 Answers1

3

Here is one way to do it.

Sample output

\documentclass[11pt]{report}
\usepackage{tikz}
\usetikzlibrary{positioning,decorations.pathreplacing,calc}
\usetikzlibrary{bayesnet}
\begin{document}

\begin{figure}
    \centering
    \tikz{ %
        \node[latent]                       (phi)   {$\phi$};
        \node[latent,   above = of phi]     (y)     {$y$};
        \node[obs,      left = of y]        (Obs_y) {$ \tilde {\bf{y}}$};
        \node[latent,   below = of Obs_y]   (sigma) {$\sigma_y$};
        \edge {phi} {y};
        \edge {y, sigma} {Obs_y};
        \draw[decorate,decoration={brace}] ($(sigma)+(0.5,-0.5)$) --
        node[below]{$x$} ++(-1,0) ; 
}
\end{figure}
\end{document}

For a brace across the bottom below sigma_y and phi you can use

\documentclass[11pt]{report}
\usepackage{tikz}
\usetikzlibrary{positioning,decorations.pathreplacing,quotes}
\usetikzlibrary{bayesnet}
\begin{document}

\begin{figure}
    \centering
    \tikz{ %
        \node[latent]                       (phi)   {$\phi$};
        \node[latent,   above = of phi]     (y)     {$y$};
        \node[obs,      left = of y]        (Obs_y) {$ \tilde {\bf{y}}$};
        \node[latent,   below = of Obs_y]   (sigma) {$\sigma_y$};
        \edge {phi} {y};
        \edge {y, sigma} {Obs_y};
        \path (sigma.south west)
        edge[decorate,decoration={brace,mirror,raise=.15cm},"$x$"below=6pt]
        (sigma.south west -| phi.south east);
}
\end{figure}
\end{document}

Second sample

Andrew Swann
  • 95,762