我正在尝试将文本 (text + $math$) 对齐到 pgfplot 中的图例中。尽管我设置了“图例单元格对齐=左”,但文本仍然居中。您猜对了吗?
\documentclass[]{article}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{figure}[!t]
\subfloat[caption subfig 1]{
\resizebox{.45 \linewidth}{!}{%
\begin{tikzpicture}
\begin{axis}[xlabel={labelX}, ylabel={labelY}, ymin=16, xmin=53, ymax=35.2, xmax=58, legend cell align=left, legend style={legend pos=north west,font=\tiny}]
\addplot[mark=x,red,only marks] table[x index=6,y index=7]{./figures1.txt};
\addlegendentry{\large{text + math $h_{1}$}}
\addplot[mark=o,blue,only marks] table[x index=6,y index=7]{./figures2.txt};
\addlegendentry{\large{more text + math $h_{1}$}}
\end{axis}
\end{tikzpicture}
}
}
\qquad
\subfloat[caption subfig 2]{
\resizebox{.45 \linewidth}{!}{%
\begin{tikzpicture}
\begin{axis}[xlabel={labelX}, ylabel={labelY}, ymin=16, xmin=53, ymax=35.2, xmax=58, legend cell align=left, legend style={legend pos=north west,font=\tiny}]
\addplot[mark=x,red,only marks] table[x index=6,y index=7]{./figures3.txt};
\addlegendentry{\large{text + math $h_{1}$}}
\addplot[mark=o,blue,only marks] table[x index=6,y index=7]{./figures4.txt};
\addlegendentry{\large{more text + math $h_{1}$}}
\end{axis}
\end{tikzpicture}
}
}
\caption{caption fig}
\end{figure}
\end{document}
谢谢!