I try to put the two pictures side by side using the following code, however, the size of the two pictures are very small like the picture.
However, the picture looks like if I don't put them together.
I don't know why.
\usepackage[latin1]{inputenc}
\usetikzlibrary{trees}
\usepackage{verbatim}
\begin{figure}[htbp]
\begin{minipage}{0.5\linewidth}
\centering
\resizebox{.6\textwidth}{!}{
\tikzset{level 1/.style={level distance=0.7cm, sibling distance=4.5cm}}
\tikzset{level 2/.style={level distance=0.7cm, sibling distance=5cm}}
\tikzset{bag/.style={text width=20em, text centered,yshift=-0.2cm}}
\begin{tikzpicture}[grow=down, -stealth, edge from parent/.style={draw,decorate,decoration={snake, post=lineto, post length=3mm}}]
{\node[bag]{$S_0{:}(A{<}a{=1}{>}B,G_{t_{i_1}},0)$}
child{ edge from parent node[right=0.1cm]{$$}; \node[bag]{$S_{n-1}{:}(stop_{good},t_{i_1}{\geq}2,0)$}
}
child{edge from parent node{$\times$}; \node[bag]{$S_n{:}(stop_{good},t_{i_3}{\geq}3,0)$}
};
}
\end{tikzpicture}}
\caption{A Circle}
\label{fig:circle}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
\centering
\resizebox{.6\textwidth}{!}{
\tikzset{level 1/.style={level distance=0.7cm, sibling distance=4.5cm}}
\tikzset{level 2/.style={level distance=0.7cm, sibling distance=5cm}}
\tikzset{bag/.style={text width=20em, text centered,yshift=-0.2cm}}
\begin{tikzpicture}[grow=down, -stealth, edge from parent/.style={draw,decorate,decoration={snake, post=lineto, post length=3mm}}]
{\node[bag]{$S_0{:}(A{<}a{=1}{>}B,G_{t_{i_1}},0)$}
child{ edge from parent node[right=0.1cm]{$$}; \node[bag]{$S_{n-1}{:}(stop_{good},t_{i_1}{\geq}2,0)$}
}
child{edge from parent node{$\times$}; \node[bag]{$S_n{:}(stop_{good},t_{i_3}{\geq}3,0)$}
};
}
\end{tikzpicture}}
\caption{A Rectangle}
\label{fig:rectangle}
\end{minipage}
\end{figure}
Best Answer
You've resized the images with
\resizebox
. Part of the reason they're so small, is that within aminipage
,\textwidth
is set to the width of theminipage
. Hence, when you set the width to be0.6\textwidth
within a minipage that is0.5\linewidth
, the width of the resizebox will be 0.3 of the\linewidth
for the whole page.In addition, because you've set the
text width
of thebag
nodes to20em
, there is some whitespace on the sides of each tree, and the size of the\resizebox
includes this whitespace.Also, please include full examples, including all packages and libraries. Makes it easier for trying to help, not having to figure out which
decorations
library is missing.See if this is a little better: