I'm trying to make bar charts using pgfplots in TeXShop 2.47.
I tried typesetting the following example from the pgfplots manual and it worked fine:
Code: Select all
\documentclass[a4paper]{article}
\usepackage{pgfplots}
%I had to leave this line out though - \pgfplotsset{width=7cm,compat=1.8}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot+[ybar] plot coordinates
{(0,3) (1,2) (2,4) (3,1) (4,2)};
\end{axis}
\end{tikzpicture}
\end{document}
Code: Select all
\usepackage{pgfplots}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ybar,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1},
ylabel={\#participants},
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}
\end{document}
./Untitled.tex:21: Package PGF Math Error: Could not parse input 'tool9' as a floating point number, sorry. The unreadable part was near 'tool9'..
Does anyone know a way to get round this?
I guess TeXShop must use an old version of pgfplots, but I'm not sure which. I'm trying to find out how to install version 1.8 of pgfplots, but I haven't been able to move the pgfplots_1.8.tds download out of my User directory to put it with the LaTeX files. The terminal says permission denied.
I'd be very grateful if anyone could help.
Thanks in advance.