I'm making a ybar graph (vertical bars) where the y axis maximum reaches 150+, but a lot of values are 0's. I would like the final graph would not show a minimum bar in this 0 values, since we this values it can easily be mistaken with a low value (1,2, etc).
My code:
\documentclass{article} % ---------------------------------- tikz \usepackage{pgfplots} % to print charts \pgfplotsset{compat=1.8} \begin{document} \begin{figure} \centering \begin{tikzpicture} \begin{axis} [ % general ybar, scale only axis, height=0.5\textwidth, width=1.2\textwidth, ylabel={# Dots}, nodes near coords, xlabel={Variation}, xticklabel style={ rotate=90, anchor=east, }, enlarge x limits={abs value={3}}, ] \addplot table [ x=grade, y=value, ] { grade value -11 0 -10 0 -9 0 -8 0 -7 0 -6 0 -5 3 -4 1 -3 2 -2 15 -1 11 0 179 1 8 2 1 3 0 4 1 5 2 6 0 7 0 8 0 9 0 10 0 11 0 }; \end{axis} \end{tikzpicture} \end{figure} \end{document}
My graph: