I apologize if this has already been covered in some other posts, but I couldn't find it anywhere and I'm not even sure if "brace diagram" is the correct name in English.
I have found some examples of probability trees, and some others that are close (like this: Draw Curly Braces in TikZ), but while playing with them I couldn't get the correct output (The part of the first "text here" when out of boundaries into the brace).
What I'm trying to do is something like this with TikZ
:
I know there are some ways to do this with mathmode, but I'm really interested in learning a little more about TikZ
and how it works for diagrams like this.
tikzpicture
code, that's why I have a graphic representation of what I'm trying to achieve. I want to know how this could be done withtikz
.left
to the relevantnode
, as innode [left,black,midway,xshift=-0.6cm] {\footnotesize $P_1$}
; you will probably also need to adjust thexshift
value after doing this. Second, braces inTikZ
are generally used to add labels after the "main objects" have already been placed. Using them as part of the "structure" of a tree is certainly possible, but it hardly seems worth the effort when thecases
environment is available.