我最近开始使用 pgfplots,现在我正尝试使用相同的数据生成两个水平对齐的图。所以我想对两个图使用一个居中的图例。这一切都非常基本,pgfplots 手册中给出的描述几乎完全符合我的需求。唯一的问题是,如上标题所述,使用 x 轴标签和图形环境的标签,一切看起来都有点拥挤。我试图在和\vspace
之间添加一些,但这只会压低图形标签。有没有办法在 x 轴标签和图例条目之间添加一些空间?\end{tikzpicture}
\ref{named}
\documentclass[a4paper]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{figure}
\begin{center}
\begin{tikzpicture}[baseline]
\begin{axis}[
legend columns=-1,
legend entries={GDR C016,GDR K01174,WA C016},
legend to name=legende,
width=0.48\textwidth,
height=0.6\textwidth,
grid=major,
xlabel={Concentration[ng/mL]},
minor x tick num=1,
ylabel={Remission [CU]},
ymin=0,
ymax=250,
minor y tick num=1]
\addplot[mark=*,blue] plot coordinates {
(0.0,196.5)(0.1,182.3)(0.2,173.1)(0.5,116.7)(1.0,47.7)};
\addplot[mark=*,red] plot coordinates {
(0.0,151.5)(0.1,131.5)(0.2,114.5)(0.5,77.6)(1.0,34.7)};
\addplot[mark=*,olive] plot coordinates {
(0.0,232.5)(0.1,123.1)(0.2,63.7)(0.5,33.9)(1.0,23.9)};
\fill[gray,fill opacity=0.2] (axis cs:-0.1,150) rectangle (axis cs:1.1,200);
\fill[green,fill opacity=0.2] (axis cs:-0.1,0) rectangle (axis cs:1.1,30);
\end{axis}
\end{tikzpicture}%
%
\hskip 10pt
%
\begin{tikzpicture}[baseline]
\begin{axis}[
width=0.48\textwidth,
height=0.6\textwidth,
grid=major,
xlabel={Concentration [ng/mL]},
minor x tick num=1,
ylabel={Displacement [\%]},
ymin=0,
ymax=110,
minor y tick num=1]
\addplot[mark=*,blue] plot coordinates {
(0.0,100)(0.1,92.8)(0.2,88.1)(0.5,59.4)(1.0,24.3)};
\addplot[mark=*,red] plot coordinates {
(0.0,100)(0.1,86.8)(0.2,75.6)(0.5,51.2)(1.0,22.9)};
\addplot[mark=*,olive] plot coordinates {
(0.0,100)(0.1,52.9)(0.2,27.4)(0.5,14.6)(1.0,10.3)};
\end{axis}
\end{tikzpicture}
\ref{legende}
\caption{Verschiedene Polyhaptene im Schnelltest}
\end{center}
\end{figure}
\end{document}
提前致谢,克里斯