我尝试将节点添加到每个条形图的顶部,但如图所示,它不起作用。我该如何格式化它?另外,为什么第 6 个 x 间隔没有显示在图表上(即 75 温度)?
\documentclass[11pt, flushleft]{article}
\usepackage[margin = 1in]{geometry}
\usepackage{gensymb}
\usepackage{tikz,pgfplots}
\begin{document}
\pgfplotstableread[row sep=\\,col sep=&]{
temperature & T1 & T2 & T3 \\
5 & 1 & 1.1 & 1.2 \\
20 & 2 & 2.1 & 2.2 \\
35 & 15.5 & 10.4 & 13.4 \\
50 & 14.0 & 17.3 & 22.2 \\
65 & 7.9 & 21.1 & 27.0 \\
75 & 7.9 & 7.9 & 7.9\\ %weird
}\data
\begin{tikzpicture}
\begin{axis}[
ybar interval,
bar width=.5cm,
width=\textwidth,
height=.4\textwidth,
legend style={at={(0.5,1)}, anchor=north,legend columns=-1},
symbolic x coords={5,20,35,50,65, 75},
xtick=data,
minor y tick num = 1,
nodes near coords,
ymin=0,
title={\textbf{Graph 1:}},
ylabel={\textbf{Rate of Reaction (cm/minute)}},
xlabel={\textbf{Temperature\degree C}}
]
\addplot table[x=temperature,y=T1]{\data};
\addplot table[x=temperature,y=T2]{\data};
\addplot table[x=temperature,y=T3]{\data};
\legend{Trial 1, Trial 2, Trial 3}
\end{axis}
\end{tikzpicture}
\end{document}