我正在寻找一种方法,使用 pgfplots 为图矩阵仅制作一个 xlabel。我当前的图如下所示
并希望在绘制红色圆圈的位置有一个 xlabel。
该情节的代码很长,但我还是在这里分享一下。
\begin{figure}[ht]
\centerfloat
% The VCG
\subbottom[VCG with no rotation. QRS-axis angle: 30 degrees]{\label{fig:0rotationFrontalVCG}%
$\vcenter{\hbox{
\begin{tikzpicture}
\begin{axis}[
title = {Frontal VCG},
axis equal image,
xlabel= {Right to Left},
ylabel= {Inferior to Superior},
ymin = -1000, ymax = 1000,
xmin = -1000, xmax = 1000,
]
% Plot the VCG
\addplot[black] table[x = VCGX, y expr = \thisrow{VCGY}*(-1), select coords between index={239}{282}] {data/vcg_analysis_section/frontal_vcg_rotation/30degree.dat}
[postaction={decorate, decoration={markings,
mark=between positions 1/15 and 1 step 1/15 with {\arrow[black,line width=1.5pt]{>};}
}}]
;
% Add the circle
\draw (axis cs:0,0) circle [black, radius=892.1472];
% Add the axis through (0,0)
\addplot[black, -] coordinates {(0, -895) (0, 895)};
\addplot[black, -] coordinates {(-895, 0) (895, 0)};
% Add the QRS-axis
\addplot[red, ->, -triangle 60, line width = 1pt] coordinates {(0, 0) ({cos(-30)*895}, {sin(-30)*895})};
\end{axis}
\end{tikzpicture}
}}$
}
\quad \quad
% The 6 ECG's
\subbottom[Lead I-III plus augmented limb leads shown in cabrera order.]{\label{fig:0rotationFrontalECG}%
$\vcenter{\hbox{
\begin{tikzpicture}
\pgfplotsset{small}
\matrix {
\begin{axis}[title = Lead aVL, width=0.4\textwidth]
\addplot[black] table[x expr=\coordindex, y=aVL] {data/vcg_analysis_section/frontal_vcg_rotation/30degree.dat};
\end{axis}
\pgfmatrixnextcell
\begin{axis}[title = Lead II, width=0.4\textwidth]
\addplot[black] table[x expr=\coordindex, y=II] {data/vcg_analysis_section/frontal_vcg_rotation/30degree.dat};
\end{axis}
\\
\begin{axis}[title = Lead I, width=0.4\textwidth,ylabel=Amplitude]]
\addplot[black] table[x expr=\coordindex, y=I] {data/vcg_analysis_section/frontal_vcg_rotation/30degree.dat};
\end{axis}
\pgfmatrixnextcell
\begin{axis}[title = Lead aVF, width=0.4\textwidth]
\addplot[black] table[x expr=\coordindex, y=aVF] {data/vcg_analysis_section/frontal_vcg_rotation/30degree.dat};
\end{axis}
\\
\begin{axis}[title = Lead -aVR, width=0.4\textwidth]
\addplot[black] table[x expr=\coordindex, y expr = \thisrow{aVR}*(-1)] {data/vcg_analysis_section/frontal_vcg_rotation/30degree.dat};
\end{axis}
\pgfmatrixnextcell
\begin{axis}[title = Lead III, width=0.4\textwidth]
\addplot[black] table[x expr=\coordindex, y=III] {data/vcg_analysis_section/frontal_vcg_rotation/30degree.dat};
\end{axis}
\\
};
\end{tikzpicture}
}}$
}
\caption{Caption for the whole figure}
\label{fig:}
\end{figure}
标签应放置在最后两个图的中间。
答案1
感谢@percusse,我切换到groupplots然后发现这个问答对我有帮助: 创建与多个图重叠的 x 和 y 标签