我想在条形图中的条形图上方放置一些文字标签。为了给它们腾出空间,我尝试使用enlarge limits
,但看起来它会改变我的整个情节,切断底部。我怎么能解决这个问题?
我附加了代码,原始图和行enlarge y limits
未注释的图片。
\begin{tikzpicture}
\begin{axis}[
xlabel = {loss},
ylabel = {probability},
enlarge x limits=0.2,
%enlarge y limits={rel=0.2,upper},
bar width = 16pt,
width=14cm,
height=8cm,
xtick=data]
\addplot[ybar,fill=white] coordinates {(-10,0.9) (0,0.095) (95,0.005)};
\node[above] at (axis cs:-10,0.9) {$90\%$};
\node[above] at (axis cs:0,0.095) {$9.5\%$};
\node[above] at (axis cs:95,0.005) {$0.5\%$};
\end{axis}
\end{tikzpicture}
\end{figure}