我正在尝试使两个表面相交但出现一条警告消息:
Package pgfplots Warning: You have an axis with empty range (in direction y). R eplacing it with a default range and clearing all plots. on input line 52.
为什么会出现这种情况?
\documentclass{standalone}
\usepackage{tikz,pgfplots}
\usepgfplotslibrary{colormaps}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
domain = -4:4,
zmax = 50,
colormap/bone,
grid
]
\addplot3 [surf,color=white] {-x^2-y^2};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[axis on top,axis lines=center,xtick=\empty,ytick=\empty,ztick=\empty,view={130}{30},xmax=1.2,ymax=1.2,zmin=0,zmax=0.03]
%\addplot3[surf,samples=25,domain=0:1,shader=interp] {x*(1-x)*y*(1-y)};
\addplot3[surf,color=white,domain=-1:1] {-x^2-y^2};
\addplot3[surf,samples=25,domain=0:1] {x-y-1.1};
%\addplot3 [surf,fill=white] coordinates { (1.1,0,0) (0,1.1,0) (0,1.1,0.02) (1.1,0,0.02) };
\end{axis}
\end{tikzpicture}
\end{document}
比较图像因为方程-x^2-y^2
。
答案1
您收到消息“Package pgfplots 警告:您的轴有空范围(在 y 方向上)”,因为您设置了 xmax 和 ymax 值,但没有设置 xmin 和 ymin。xmin=0, ymin=0
例如,一旦您添加,该消息就会消失。