我正在寻找一种使用 pgfplots 创建以下曲面图的方法:
使用 matlab2tikz 我得到了以下代码:
\begin{tikzpicture}[%
trim axis left, trim axis right
]
\begin{axis}[%
colormap={patchmap}{[1pt] rgb(0pt)=(1,0,0); rgb(2499pt)=(1,0,0)},
every outer x axis line/.append style={black},
every x tick label/.append style={font=\color{black}},
xmin=0.0,
xmax=2000.0,
tick align=outside,
xmajorgrids,
every outer y axis line/.append style={black},
every y tick label/.append style={font=\color{black}},
ymin=0.0,
ymax=4000.0,
ymajorgrids,
every outer z axis line/.append style={black},
every z tick label/.append style={font=\color{black}},
zmin=0.0,
zmax=500.0,
zmajorgrids,
view={-37.5}{30.0},
axis background/.style={fill=white},
axis x line*=bottom,
axis y line*=left,
axis z line*=left,
]
\addplot3[%
surf,
fill opacity=0.75,shader=flat corner,draw=black,z buffer=sort,colormap/jet,mesh/rows=50]
table[row sep=crcr, point meta=\thisrow{c}] {%
%
x y z c\\
10.0 50.0 4.2 4.2\\
10.0 130.0 10.7 10.7\\
% MORE DATA HERE
\addplot3[%
surf,
shader=flat corner,draw=black,z buffer=sort,mesh/rows=50]
table[row sep=crcr, colormap name=surfmap, point meta=\thisrow{c}] {%
%
x y z c\\
10.0 50.0 200.0 0.0\\
10.0 130.0 200.0 1.0\\
10.0 210.0 200.0 2.0\\
% MORE DATA HERE
};
\end{axis}
\end{tikzpicture}%
我想知道为什么它colormap name=surfmap
在第二个情节中说,但改变那一行并colormap name=patchmap
没有解决问题:
“喷气”色彩图和不透明度似乎都不起作用。
有什么问题?提前谢谢您!