![更改一些特定的 xticklabel 樣式](https://rvso.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%A8%A3%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
。我該如何修復它?