是否可以使用函数或任何函数来绘制图形?

是否可以使用函数或任何函数来绘制图形?

让我们画一个函数y=x^3(第一个数字)y=x^4(第二个数字),, 像下面的图形一样,我使用 Microsoft 数学来绘制它。

图形 y= x^3 y=x^4

答案1

是的,这可以很容易地使用pgfplots,一旦您参数化了表面

x(t,s)=t
y(t,s)=t^3
z(t,s)=s

请注意,由于pgfplots使用的语法,我使用了

    \addplot3[surf,shader=flat,samples=20,]({x},{x^3},{y});

在下面的代码中;x代表t,并且y代表s

在此处输入图片描述

% arara: pdflatex
% !arara: indent: {overwrite: true, trace: true}
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}

\begin{tikzpicture}
    \begin{axis}
    \addplot3[surf,shader=flat,samples=20,]({x},{x^3},{y});
    \end{axis}
\end{tikzpicture}

\end{document}

相关内容