![更改一些特定的 xticklabel 样式](https://linux22.com/image/420757/%E6%9B%B4%E6%94%B9%E4%B8%80%E4%BA%9B%E7%89%B9%E5%AE%9A%E7%9A%84%20xticklabel%20%E6%A0%B7%E5%BC%8F.png)
我想更改一些xticklabel
样式,但不是全部,只更改少数样式,并且不更改特定位置(因此不会总是第一个或最后一个)。我怎样才能仅将(例如,(3,5))标签更改为(Hello, World)并更改其字体大小,使其变为粗体并为其添加下划线?
\documentclass{article}
\usepackage{pgfplots}
\usepackage{adjustbox}
\pgfplotsset{compat=1.8}
\usepgfplotslibrary{groupplots}
\title{Hello}
\author{}
\date{} % remove to get todays date
\begin{document}
\maketitle % prints the info from \title, \author, \date
\begin{adjustbox}{center}
\begin{tikzpicture}
\pgfplotsset{enlarge y limits={value=0.15,upper}}
\pgfplotsset{xtick style={draw=none}}
\begin{groupplot}[
group style={
group size=1 by 2,
vertical sep=1.8cm
},
/pgfplots/ymin=0,
height=10cm,width=20cm,
ybar stacked,
/pgf/bar width=1.66667cm,
legend style={at={(0.5,1.125)},
anchor=north,legend columns=-1,font=\Large},
ylabel={\%},
symbolic x coords={1,2,3,4,5,6,7,8,9},
xtick=data,
x=2cm,
enlarge x limits={abs=1.16667cm},
x tick label style={rotate=45,anchor=north east, inner sep=5pt},
xticklabels={1,2,3,4,5,6,7,8,9},
]
\nextgroupplot
\addplot+[fill=green,ybar,draw=black] plot coordinates {(1,5.07379)(2,5.94374)(3,6.18943)(4,7.70475)(5,20.8031)(6,2.14308)(7,8.02659)(8,1.30789)(9,31.2347)};
\addplot+[fill=brown,ybar,draw=black] plot coordinates {(1,2.66531)(2,0.87115)(3,1.52316)(4,0.350975)(5,0.299016)(6,0.216008)(7,4.20682)(8,0.237877)(9,1.20268)};
\legend{\strut action 1, \strut action 2}
\end{groupplot}
\end{tikzpicture}
\end{adjustbox}
\end{document}
因此,我尝试在周围实现这个红色框,very long text
但它会自行叠加,3
并且红色方块只在周围3
。我该如何修复它?