I want to draw a Tikz diagram, in which an ellipse contains a row of smaller ellipses. I tried doing so using the fitting library:
\begin{tikzpicture}[
every node/.style={inner sep=1pt},
proc/.style={shape=ellipse, draw}
]
\path node[proc] (q) {q} -- ++(2cm,0)
node[proc] (p1) {p$_1$} -- ++(1.5cm,0)
node (d) {\ldots} -- ++(1.5cm,0)
node[proc] (pn) {p$_n$};
\node[fit=(q)(p1)(d)(pn), proc] {};
\end{tikzpicture}
The result is a long and narrow ellipse:
I would prefer the surrounding ellipse to be shorter and taller, i.e., end closer to the q
and pn
nodes, and also have slightly more height. What is the right configuration for this?
Best Answer
My original answer is below the line. Here's a slightly improved version, which uses two "strategically-placed" pegs to distort the ellipse. I think this approach will need less manual fine tuning (of
envel/inner sep
andpeg/node distance
).Here's a slightly exaggerated answer. I suggest you play with the
envel
construction'sinner sep
andminimum height
parameters to find what suits you best.