我是 pgf 的新手,所以我尝试了 pgfplot 手册中的一些示例。一个例子与我当前的任务特别相关,但是,唉,它不会编译。
这是代码:
\documentclass[11pt]{article}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[symbolic x coords={a,b,c,d,e,f,g,h,i}]
\addplot+[smooth] coordinates {
(a,42)
(b,50)
(c,80)
(f,60)
(g,62)
(i,90)};
\end{axis}
\end{tikzpicture}
\end{document}
编译器退出并出现以下错误:
! Package PGF Math Error: Could not parse input 'a' as a floating point number,
sorry. The unreadable part was near 'a'..
我不知道如何纠正这种行为。仅包含数字数据的其他图(平滑、散点图、条形图)编译得很好。
有人可以给我一个提示吗?
干杯
K。