尝试绘制 3D 曲线

尝试绘制 3D 曲线

(exp(t)*cos(t), exp(t)*sin(t), exp(t)我尝试使用代码绘制曲线

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}

\begin{document}
\begin{figure}[h]
 \begin{tikzpicture}
    \begin{axis}
      [view={60}{30}, axis lines=center,axis on top,
       xlabel=$x$,ylabel=$y$,zlabel=$z$,
       xtick={10},ytick={10},ztick={10},
       no marks,axis equal,
       xmin=-1,xmax=10,ymin=-1,ymax=10,zmin=-1,zmax=10,
       enlargelimits={upper=0.1}]
        \addplot3+[color=black, no markers,samples=1001, samples y=0, domain=0:10, variable=\t]
     ( {(exp(\t))*cos(\t r)}, {(exp(\t))*sin(\t r)}, {exp(\t)} );
    \end{axis}
   \draw (1.6,1.7) node {$O$};
 \end{tikzpicture}
 \end{figure}
\end{document} 

错误是!Dimension too large. 我哪里错了?

答案1

嗯,exp(10) 是一个相当大的数字。为什么不直接用 exp(-5) 重新缩放所有维度呢?

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}

\begin{document}
\begin{figure}[h]
 \begin{tikzpicture}
    \begin{axis}
      [view={60}{30}, axis lines=center,axis on top,
       xlabel=$x$,ylabel=$y$,zlabel=$z$,
       xtick={10},ytick={10},ztick={10},
       no marks,axis equal,
       xmin=-1,xmax=10,ymin=-1,ymax=10,zmin=-1,zmax=10,
       enlargelimits={upper=0.1}]
        \addplot3+[color=black, no markers,samples=1001, samples y=0,
        domain=0:10, variable=\t]
     ( {(exp(\t-5))*cos(\t r)}, {(exp(\t-5))*sin(\t r)}, {exp(\t-5)} );
    \end{axis}
   \draw (1.6,1.7) node {$O$};
 \end{tikzpicture}
 \end{figure}
\end{document} 

相关内容