同一轴上的两个图形\addplot3(pgfplots)
我想用pgfplots画两张图。这是第一个: , 这是第二个: 当我试图在同一个轴上绘制两个图形时,就会发生这种情况 , 也就是说,我的第二张图与第一张图在零点附近重叠。如何使第一个图形在零附近与第二个图形重叠?很明显,如果更改调用\addplot3的顺序,则第一个图形将与第二个图形重叠。我只希望在零点附近,这样图片看起来像这样 TEX文件同一轴上的两个图形\addplot3(pgfplots),plot,latex,pgfplots,Plot,Latex,Pgfplots,我想用pgfplots画两张图。这是第一个: , 这是第二个: 当我试图在同一个轴上绘制两个图形时,就会发生这种情况 , 也就是说,我的第二张图与第一张图在零点附近重叠。如何使第一个图形在零附近与第二个图形重叠?很明显,如果更改调用\addplot3的顺序,则第一个图形将与第二个图形重叠。我只希望在零点附近,这样图片看起来像这样 TEX文件 \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usep
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{amsmath,amssymb}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, russian]{babel}
\pgfplotsset{compat=1.9}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=-pi,
xmax=pi,
ymin=-pi,
ymax=pi,
zmin=0,
zmax=2.5,
xlabel={$\varkappa_x$},
ylabel={$\varkappa_y$},
zlabel={$\omega$},
xtick={-pi,-pi/2,0,pi/2,pi},
xticklabels={$-\pi$,$-\frac{\pi}{2}$,$0$,$\frac{\pi}{2}$,$\pi$},
ytick={-pi,-pi/2,0,pi/2,pi},
yticklabels={$-\pi$,$-\frac{\pi}{2}$,$0$,$\frac{\pi}{2}$,$\pi$}
]
\addplot3[surf,domain=-pi:pi,samples=35]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2-sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\addplot3[surf,domain=-pi:pi,samples=35]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2+sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\end{axis}
\end{tikzpicture}
\end{document}
您可以重新绘制第一个函数的部分:
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=-pi,
xmax=pi,
ymin=-pi,
ymax=pi,
zmin=0,
zmax=2.5,
xlabel={$\kappa_x$},
ylabel={$\kappa_y$},
zlabel={$\omega$},
xtick={-pi,-pi/2,0,pi/2,pi},
xticklabels={$-\pi$,$-\frac{\pi}{2}$,$0$,$\frac{\pi}{2}$,$\pi$},
ytick={-pi,-pi/2,0,pi/2,pi},
yticklabels={$-\pi$,$-\frac{\pi}{2}$,$0$,$\frac{\pi}{2}$,$\pi$}
]
\addplot3[surf,domain=-pi:pi,samples=40]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2-sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\addplot3[surf,domain=-pi:pi,samples=40]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2+sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\addplot3[
surf,
domain=0:pi,
y domain=-pi:0,
samples=20,
]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2-sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\end{axis}
\end{tikzpicture}
\end{document}
非常感谢。有没有任何参数使得更接近“观察者”的点叠加在其他点上?我不这么认为
\begin{tikzpicture}
\begin{axis}[
xmin=-pi,
xmax=pi,
ymin=-pi,
ymax=pi,
zmin=0,
zmax=2.5,
xlabel={$\varkappa_x$},
ylabel={$\varkappa_y$},
zlabel={$\omega$},
xtick={-pi,-pi/2,0,pi/2,pi},
xticklabels={$-\pi$,$-\frac{\pi}{2}$,$0$,$\frac{\pi}{2}$,$\pi$},
ytick={-pi,-pi/2,0,pi/2,pi},
yticklabels={$-\pi$,$-\frac{\pi}{2}$,$0$,$\frac{\pi}{2}$,$\pi$}
]
\addplot3[surf,domain=-pi:pi,samples=40]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2-sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\addplot3[surf,domain=-pi:pi,samples=40]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2+sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\end{axis}
\end{tikzpicture}
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{amsmath,amssymb}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, russian]{babel}
\pgfplotsset{compat=1.9}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=-pi,
xmax=pi,
ymin=-pi,
ymax=pi,
zmin=0,
zmax=2.5,
xlabel={$\varkappa_x$},
ylabel={$\varkappa_y$},
zlabel={$\omega$},
xtick={-pi,-pi/2,0,pi/2,pi},
xticklabels={$-\pi$,$-\frac{\pi}{2}$,$0$,$\frac{\pi}{2}$,$\pi$},
ytick={-pi,-pi/2,0,pi/2,pi},
yticklabels={$-\pi$,$-\frac{\pi}{2}$,$0$,$\frac{\pi}{2}$,$\pi$}
]
\addplot3[surf,domain=-pi:pi,samples=35]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2-sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\addplot3[surf,domain=-pi:pi,samples=35]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2+sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\end{axis}
\end{tikzpicture}
\end{document}
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=-pi,
xmax=pi,
ymin=-pi,
ymax=pi,
zmin=0,
zmax=2.5,
xlabel={$\kappa_x$},
ylabel={$\kappa_y$},
zlabel={$\omega$},
xtick={-pi,-pi/2,0,pi/2,pi},
xticklabels={$-\pi$,$-\frac{\pi}{2}$,$0$,$\frac{\pi}{2}$,$\pi$},
ytick={-pi,-pi/2,0,pi/2,pi},
yticklabels={$-\pi$,$-\frac{\pi}{2}$,$0$,$\frac{\pi}{2}$,$\pi$}
]
\addplot3[surf,domain=-pi:pi,samples=40]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2-sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\addplot3[surf,domain=-pi:pi,samples=40]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2+sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\addplot3[
surf,
domain=0:pi,
y domain=-pi:0,
samples=20,
]{sqrt(2*sin(deg((x+y)/2))^2+sin(deg(x/2))^2+sin(deg(y/2))^2-sqrt(4*sin(deg((x+y)/2))^4+(sin(deg(x/2))^2-sin(deg(y/2))^2)^2))};
\end{axis}
\end{tikzpicture}
\end{document}