0
我試圖使用.csv文件中的數據創建非數字標籤的條形圖。我已經瀏覽了一些較老的例子,但它們看起來很龐大笨重。我希望有更好的方法。這裏是我到目前爲止的MWE:LaTeX pgfplots使用字符串作爲條形圖標籤來自.csv
\documentclass[11pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xlabel=x axis label,ylabel=y axis label]
\addplot [ybar] table [symbolic x coords=Month, y=Dozers, col sep=comma] {cnrldata.csv};
\end{axis}
\end{tikzpicture} \\
\end{document}
從這個我當然得到的錯誤:
Package PGF Math Error: Could not parse input 'May 14' as a floating point number, sorry. The unreadable part was near 'May 14'.. ... y=Dozers, col sep=comma] {data.csv};
該表中的數據是這樣的:
Month, Dozers,
January, 0.85,
February, 0.7,