\documentclass{article}
\usepackage[a4paper,bindingoffset=0.2in,%
left=1in,right=1in,top=1in,bottom=1in,%
footskip=.25in]{geometry}
\usepackage[magyar]{babel}
\usepackage[utf8]{inputenc}
\usepackage{t1enc}
\usepackage{amsmath}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
ylabel=Eltérés,
enlargelimits=0.2,
ybar interval=0.8,
]
\addplot
coordinates {(1,25) (2,8.5)
(3,7.9) (4,3.8) (5,4.2) (6,7.7) (7,6.8) (8,3.2) (9,15.2) };
\end{axis}
\end{tikzpicture}
\end{document}
答案1
因此,如果您想要(9,15.2)
显示,请添加另一个坐标或将图更改为ybar
(不带interval
):
\documentclass{article}
\usepackage[a4paper,bindingoffset=0.2in,%
left=1in,right=1in,top=1in,bottom=1in,%
footskip=.25in]{geometry}
\usepackage[magyar]{babel}
\usepackage[utf8]{inputenc}
\usepackage{t1enc}
\usepackage{amsmath}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
ylabel=Eltérés,
enlargelimits=0.2,
ybar,% interval=0.8,
]
\addplot
coordinates {(1,25) (2,8.5)
(3,7.9) (4,3.8) (5,4.2) (6,7.7) (7,6.8) (8,3.2) (9,15.2) };
\end{axis}
\end{tikzpicture}
\end{document}