2

When using pgfplots's hist in combination with nodes near coords, the nodes are misplaced on the edges of the bars and the last node is shown twice.

Is this a bug or is nodes near coords not meant to be used with hist?

Issue:

Issue

MWE:

\documentclass[border=20pt]{standalone}

\usepackage{pgfplots} \pgfplotsset{compat=1.10}

\usepackage{filecontents} \begin{filecontents}{data.dat} 4.60000000e+02 4.60000000e+02 4.60000000e+02 4.60000000e+02 4.60000000e+02 4.52000000e+02 4.48000000e+02 4.60000000e+02 4.60000000e+02 4.60000000e+02 3.88000000e+02 3.32000000e+02 4.60000000e+02 3.20000000e+02 3.52000000e+02 3.28000000e+02 4.32000000e+02 4.60000000e+02 4.60000000e+02 4.60000000e+02 4.60000000e+02 4.60000000e+02 4.60000000e+02 4.04000000e+02 4.52000000e+02 1.20000000e+02 4.60000000e+02 1.80000000e+02 4.48000000e+02 4.60000000e+02 3.24000000e+02 3.52000000e+02 4.60000000e+02 2.32000000e+02 3.76000000e+02 3.48000000e+02 4.60000000e+02 3.96000000e+02 2.56000000e+02 3.96000000e+02 4.16000000e+02 4.44000000e+02 4.52000000e+02 4.60000000e+02 4.60000000e+02 2.84000000e+02 4.36000000e+02 4.16000000e+02 4.60000000e+02 2.64000000e+02 1.64000000e+02 4.24000000e+02 4.48000000e+02 4.44000000e+02 4.52000000e+02 3.92000000e+02 4.60000000e+02 2.48000000e+02 4.36000000e+02 2.44000000e+02 4.48000000e+02 1.60000000e+02 4.48000000e+02 4.48000000e+02 4.60000000e+02 2.44000000e+02 4.60000000e+02 3.64000000e+02 4.04000000e+02 4.40000000e+02 4.60000000e+02 4.32000000e+02 4.60000000e+02 4.60000000e+02 4.60000000e+02 4.48000000e+02 1.76000000e+02 4.36000000e+02 4.60000000e+02 4.60000000e+02 4.44000000e+02 4.60000000e+02 4.60000000e+02 4.36000000e+02 4.48000000e+02 4.60000000e+02 1.76000000e+02 4.44000000e+02 4.60000000e+02 4.60000000e+02 2.72000000e+02 4.04000000e+02 4.20000000e+02 4.48000000e+02 4.60000000e+02 4.48000000e+02 4.60000000e+02 2.64000000e+02 1.72000000e+02 4.08000000e+02 2.04000000e+02 \end{filecontents}

\begin{document} \begin{tikzpicture}

\begin{axis}[% ybar interval, xticklabel=\pgfmathprintnumber\tick--\pgfmathprintnumber\nexttick, x tick label style={font=\footnotesize,inner sep=0pt,rotate=90,anchor=east,}, nodes near coords, ]

\addplot+[hist={bins=10},] table[y index=0,] {data.dat};

\end{axis}

\end{tikzpicture}%

\end{document}

sudosensei
  • 4,072

0 Answers0