分号错误和错误的参数图

分号错误和错误的参数图
\documentclass{article}

\usepackage[a4paper,top=3cm,bottom=3cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}

\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{patchplots}
\pgfplotsset{compat=1.8}
\usetikzlibrary{arrows.meta}

\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{axis}[axis lines=middle]
\addplot [green, domain=-0.25:2.5,line width=1pt,-latex,smooth] (-4/exp(x), 2*(4*x - 1)*exp(-x));
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}

以下是产生的输出:

在此处输入图片描述

这是 Mathematica 的输出:

在此处输入图片描述

这里发生了什么事?

我不明白,只能推测系统内部存在不自然的运行顺序。

答案1

我认为你只是忘了牙套。

\documentclass{article}

\usepackage[a4paper,top=3cm,bottom=3cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}

\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usetikzlibrary{arrows.meta}

\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{axis}[axis lines=middle]
\addplot [green, domain=-0.25:2.5,line width=1pt,-latex,smooth] ({-4/exp(x)},
{2*(4*x - 1)*exp(-x)});
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}

在此处输入图片描述

当然,您可以添加一些选项来使轴的缩放比例相等。

相关内容