梅威瑟:
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ybar,
title={Test},
symbolic x coords={SmallCaps, MoreSmallCaps},
xtick=data,
]
\addplot+[ybar] plot coordinates {(SmallCaps,0.5)(MoreSmallCaps,0.25)};
\addplot+[ybar] plot coordinates {(SmallCaps,0.5)(MoreSmallCaps,0.25)};
\legend{Series 1,Series 2};
\end{axis}
\end{tikzpicture}
\end{document}
是否可以强制符号 x 坐标以全部小写的形式出现在图表上?
答案1
您可以更改xticklabel style
:
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ybar,
title={Test},
symbolic x coords={SmallCaps, MoreSmallCaps},
xtick=data,
xticklabel style={font=\scshape},
]
\addplot+[ybar] plot coordinates {(SmallCaps,0.5)(MoreSmallCaps,0.25)};
\addplot+[ybar] plot coordinates {(SmallCaps,0.5)(MoreSmallCaps,0.25)};
\legend{Series 1,Series 2};
\end{axis}
\end{tikzpicture}
\end{document}