将三维绘图中的二维曲线投影到平面上

将三维绘图中的二维曲线投影到平面上

后面的平面上应该出现一条粗黑线

\begin{figure}
\begin{center}
\begin{tikzpicture}[scale=2.0]
\begin{axis}[
%xmin=0,xmax=2,
%ymin=-5,ymax=5,
%zmin=-6,zmax=2,
%xtick=\empty,
%ytick=\empty,
%ztick=\empty,
x dir=reverse,
xlabel = Frequency,
ylabel = Real,
zlabel = Imaginary,
]
\addplot3[
y domain=0:0,
domain=0:2,
samples=1000,
variable=\x,
]
(
{x},
{((x^2-1)/((x^2-1)^2+(0.2*x)^2))},
{((-0.2*x)/((1-x^2)^2+(0.2*x)^2))}
);

\addplot [domain=0:2, samples=500, smooth, color=black, ultra thick]
{((-0.2*x)/((1-x^2)^2+(0.2*x)^2))};

\end{axis}
\end{tikzpicture}
\caption{testing 5}
\end{center}
\end{figure}

答案1

图形标题包含解释。(题外话:使用 键pgfplots调整width图的宽度,并使用\centering代替\begin{center} ... \end{center}。还提供以 开头\documentclass和结尾的完整示例\end{document},如以下代码。)

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{figure} 
\centering
\begin{tikzpicture}
\begin{axis}[width=\textwidth, 
  %xmin=0,xmax=2, %
  ymin=-2.5,ymax=2.501, %<- 2.501 in order to avoif getting clipped away
  %zmin=-6,zmax=2, 
  %xtick=\empty, %ytick=\empty, 
  %ztick=\empty, 
  x dir=reverse, xlabel = Frequency, ylabel = Real, zlabel = Imaginary] 
 \addplot3[samples y=0, domain=0:2, samples=1000, variable=\x, ] ( {x}, {((x^2-1)/((x^2-1)^2+(0.2*x)^2))}, {((-0.2*x)/((1-x^2)^2+(0.2*x)^2))} );
 \addplot3[very thick,samples y=0, domain=0:2, samples=1000, variable=\x, ] ( {x}, {2.5}, {((-0.2*x)/((1-x^2)^2+(0.2*x)^2))} );
\end{axis} 
\end{tikzpicture} 
\caption{Projections on a plane can be obtained by setting the corresponding
coordinate to the location of the plane. For instance, if you wish to project
the function on the $xz$ plane at $y=2.5$, replace the second argument of
\texttt{\textbackslash addplot3} by $2.5$.}
\end{figure}
\end{document}

在此处输入图片描述

相关内容