PGFPlots:将刻度标签设为小写

PGFPlots:将刻度标签设为小写

梅威瑟:

\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}

在此处输入图片描述

相关内容