Tikz 旋转(具有 3D 效果的平面曲线)

Tikz 旋转(具有 3D 效果的平面曲线)

我正在尝试使用 TikZ 重现下面的图像。

在此处输入图片描述

我的代码,问题是红色曲线

\documentclass{standalone}
\usepackage{tikz, tkz-fct}

\begin{document}

\begin{tikzpicture}
\node (a) [] {};
\node (b) [above=5cm of a] {};
\node (c) [] at (7,2.5) {};
\node (d) [] at (9,-4.5) {};

\draw [-latex, shorten <=-4.5pt] (a) to (b);
\draw [-latex, shorten <=-4.5pt] (a) to (c);
\draw [-, shorten <=2.3cm, shorten >=-2.3cm, dashed, transform canvas={yshift=-2cm}] (a) to (c);
\draw [-, shorten <=4.8cm, shorten >=-4.8cm, dashed, transform canvas={yshift=-4cm}] (a) to (c);
\draw [-, shorten <=7.3cm, shorten >=-7.3cm, dashed, transform canvas={yshift=-6cm}] (a) to (c);
\draw [-latex, shorten <=-4.5pt] (a) to (d);

\node [rotate=-25] at (6,-1) {\begin{tikzpicture}\tkzInit[ymin=-1.3,ymax=1.3]\tkzFct[domain=pi:4*pi]{(1./10)*sin(4*x)}\tkzDefPointByFct[draw](1.93*pi)\tkzDefPointByFct[draw](1.13*pi)\tkzDefPointByFct[draw](2.79*pi)\end{tikzpicture}};

\node [rotate=20] at (12,3.8) {\begin{tikzpicture}\tkzInit[xmin=-2, ymin=-1.3,ymax=4, xstep=0.5, ]\tkzFct[domain=-1.5:1.5, red]{(3)*exp((-1)*(5)*(\x**2))}\end{tikzpicture}};

\end{tikzpicture}

\end{document}

答案1

您可以使用三维坐标系并使用xyz值绘制图形。因此,您可以调整绘图,使其看起来与三维相似,而无需使用旋转。

可以通过改变选项中的xy和值来调整视点 。ztikzpicture

\documentclass[tikz, border=5mm]{standalone}

\begin{document}
 \begin{tikzpicture}[x={(1,-.25,0)}, y={(0,1,0)}, z={(.25,0,-1)}]
    % Axes
    \begin{scope}[->, >=latex]
      \draw (0,0,0) -- (4,0,0) node [below] {$t$};% x
      \draw (0,0,0) -- (0,2,0) node [right] {$f_z(z)$};% y
      \draw (0,0,0) -- (0,0,6) node [above right] {$z(t, \omega)$};% z
    \end{scope}

    % Plots
    \draw [red, domain=-.25:pi+.5, samples=100] plot (\x, {.1*sin(6*\x r)}, {\x+1.1}) node [below] {$\mu_t$};
    \foreach \x in {1,...,3} {
      \draw [dashed] (\x,0,0) node [below] {$t_\x$} -- (\x,0,6);
      \draw [dashed] (\x, 0, \x+pi/4) node [below] {$\mu_{t\x}$} -- +(0,1,0);
      \fill (\x, 0, \x+pi/4) circle (2pt);
      \draw [domain=-pi/4:3/4*pi, variable=\z, samples=50] plot (\x, {.5+.5*sin(2*\z r)}, \x+\z);
    }
  \end{tikzpicture}
\end{document}

渲染图像

相关内容