我正在尝试使用 .csv 文件中的数据来创建带有非数字标签的条形图。我浏览了一些较旧的示例,但它们看起来又大又笨重。我希望有更好的方法。到目前为止,这是我作为 MWE 所拥有的:
\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,