I’m trying to have a diagram that shows the information produced by this MWE:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{data.csv}
Jahr, Treffer
1995-2010, 4
2005, 3
2006, 7
2007, 15
2008, 68
\end{filecontents*}
\usepackage{array}
\usepackage{csvsimple}
\usepackage{pgfplots}
\begin{document}
\csvautotabular{data.csv}
\end{document}
Instead of \csvautotabular{data.csv}, I tried this:
\begin{tikzpicture}
\begin{axis}[
ybar,
]
\addplot table [x=Jahr, y=Treffer, col sep=comma] {data.csv};
\end{axis}
\end{tikzpicture}
but get the error
! Package PGF Math Error: Could not parse input '1995-2010' as a
floating point number, sorry. The unreadable part was near '-2010'..
Is there a good way around this, like treating the 1995-2010 as a string and pretending it’s just another single year?