我尝试使用将 MATLAB 转换surf
为绘图。它无法编译并出现错误pgfplots
matlab2tikz
<to be read again>
\pgfpl@cm@surfmap@X@size
l.44 };
我是否忘记提供参数或存在不兼容性?MWE 是
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
% and optionally (as of Pgfplots 1.3):
\pgfplotsset{compat=newest}
\begin{document}
% This file was created by matlab2tikz.
%
\begin{tikzpicture}
\begin{axis}[%
width=8.558cm,
height=6cm,
at={(0cm,0cm)},
scale only axis,
colormap={patchmap}{[1pt] rgb(0pt)=(0.683515,0.87866,0.82487); rgb(1pt)=(0.992077,0.96963,0.951899); rgb(2pt)=(0.992355,0.970696,0.953586); rgb(3pt)=(0.993884,0.976557,0.962869); rgb(4pt)=(0.588067,0.842065,0.772053); rgb(5pt)=(0.947739,0.799666,0.6827); rgb(6pt)=(0.999305,0.997336,0.995781); rgb(7pt)=(0.951353,0.813519,0.704641); rgb(8pt)=(0.87776,0.953133,0.932357)},
xmin=0,
xmax=2,
ymin=0,
ymax=2,
axis background/.style={fill=white},
axis x line*=bottom,
axis y line*=left,
xmajorgrids,
ymajorgrids
]
\addplot[%
surf,
shader=flat corner, draw=black, mesh/rows=3]
table[row sep=crcr, colormap name=surfmap, point meta=\thisrow{c}] {%
%
x y c\\
0 0 0\\
0 1 1\\
0 2 2\\
1 0 3\\
1 1 4\\
1 2 5\\
2 0 6\\
2 1 7\\
2 2 8\\
};
\end{axis}
\end{tikzpicture}%
\end{document}
编辑:重新添加到MWE 中的\\
行,而不是 Runaway 参数问题。这解决了该问题,但问题仍然存在。2 2 8
pdflatex
lualatex