I am trying to create a bar chart with pgfplots
.
My code is similar to example :
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{figure}[h!]
\begin{tikzpicture}
\begin{axis}[
ybar,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},anchor=north,legend columns=-1},
ylabel=something,
symbolic x coords={tool8,tool9,tool10},
xtick=data,
nodes near coords,
nodes near coords align={vertical}]
\addplot coordinates {(tool8,7) (tool9,9) (tool10,4)};
\addplot coordinates {(tool8,4) (tool9,4) (tool10,4)};
\addplot coordinates {(tool8,1) (tool9,1) (tool10,1)};
\legend{used,understood,not understood}
\end{axis}
\end{tikzpicture}
\caption[TODO]{TODO}
\label{label}
\end{figure}
\end{document}
I get the error:
finished with exit code 1.
- Does that code give a bar chart if you run it?
- What could be the reason that it does not work for me?
- Wrong
pgfplots
version?
My output looks like this:
For each entry in coordinates
I get
Package PGF Math Error: Could not parse input 'tool8' as a floating point number, sorry. The unreadable part was near 'tool8'..
I use Xubuntu 12.04 with Kile 2.1.0 and \pgfversion
2.10
Update:
If I remove the symbolic x coords
it works fine. If I replace the toolx
by a number I get:
Package pgfkeys Error: I do not know the key '/tikz/symbolic x coords' and I am going to ignore it. Perhaps you misspelled it.