我使用包创建了这两个图pgfplots
,并使用包放入页面中subfig
。
这是我用来创建它的一部分代码。
\begin{figure}[htp]
\centering
\begin{tikzpicture}[scale=0.8]
\begin{axis}[height=7cm,
x post scale=1.4,
xmin=0,xmax=6000,ymin=0,ymax=3500,
grid=both,
ylabel=Throughput (kbit/s),
/pgf/number format/.cd,
use comma,
1000 sep={},
legend pos = north west,
legend cell align=left,
name=main plot]
\addplot[smooth,thick,blue!70]
table[x=load,y=throughput]
{./immagini/throughput_blue.txt};
\addplot[smooth,thick,green!70]
table[x=load,y=throughput]
{./immagini/throughput_green.txt};
\legend{{\footnotesize Network Coding}, {\footnotesize No Network Coding}}
\end{axis}
\begin{axis}[height=3.8cm,
x post scale=1.4,
xmin=0,xmax=6000,ymin=0,ymax=2,
grid=both,
xlabel= Carico offerto totale (kbit/s),ylabel= Guadagno codifica,
/pgf/number format/.cd,
use comma,
1000 sep={},
at={(main plot.below south west)},yshift=-0.1cm,
anchor=north west]
\addplot[smooth,thick,red!70]
table[x=load,y=gain]
{./immagini/throughput_red.txt};
\end{axis}
\end{tikzpicture}
\caption{Confronto throughput per lo scenario \emph{mobile cloud}}
\label{fig:throughput_nc}
\end{figure}
问题是,如您所见,图未垂直对齐。我不明白原因。错误在哪里?