I have two charts, one is drawn with pgfplots
, the other with pgf-pie
. I want put these two chart in align horizontally, so one is on the left and the other is on the right. I have read Aligning using flushleft and flushright, but it seems this minipage
trick does not work in my case.
This is an example. I expected the two charts stand side-by-side, but they are not. About the width of the minipage
, I tried many values. Maybe I don't understand it correctly.
\begin{minipage}{0.5 \linewidth}
\begin{flushleft}
\begin{tikzpicture}
\begin{axis}[
title=\# of players in a class,
ybar,
%enlargelimits=0.15,
legend style={at={(0.5,-0.2)},
anchor=north,legend columns=-1},
ylabel={Population},
symbolic x coords={Warrior,Wizard,Archer},
xtick=data,
nodes near coords,
nodes near coords align={vertical},
x tick label style={rotate=45,anchor=east},
]
\addplot coordinates {(Warrior,100) (Wizard,100) (Archer,200)};
\end{axis}
\end{tikzpicture}
\end{flushleft}
\end{minipage}
\begin{minipage}{0.5 \linewidth}
\begin{flushright}
Ratio of players in a class
\begin{tikzpicture}
\pie{ 25/ \textsc{Warrior} , 25/ \textsc{Wizard} , 50/ \textsc{Archer} }
\end{tikzpicture}
\end{flushright}
\end{minipage}