evo*_*olk 7 string plot axis tikz pgf
我是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}
Run Code Online (Sandbox Code Playgroud)
编译器退出时出现以下错误:
! Package PGF Math Error: Could not parse input 'a' as a floating point number,
sorry. The unreadable part was near 'a'..
Run Code Online (Sandbox Code Playgroud)
我不知道如何纠正这种行为.其他图(平滑,散点图,条形图),只包含数值数据编译.
有人可以给我一个暗示吗?
干杯
K.
您需要将其包含在序言中:
\pgfplotsset{xticklabel={\tick},scaled x ticks=false}
\pgfplotsset{plot coordinates/math parser=false}
Run Code Online (Sandbox Code Playgroud)
当我尝试使用这个命令时(特别是“绘图坐标/数学解析器”),我遇到了问题,但后来我更新了包 pgfplots 并且一切正常。
| 归档时间: |
|
| 查看次数: |
3411 次 |
| 最近记录: |