在Latex中对数内绘制指数图 pgfplots。

问题描述 投票:0回答:1

我想在我的文档中添加一些情节。我以前一直能够成功地这样做,但由于某些原因,这次却没有成功。我试着删除所有的东西,除了一个情节,但我仍然得到同样的错误。让我展示一下只有一个图的文档。

\documentclass[11pt]{amsart}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[domain=0:3,samples=100,yticklabels=\empty]
\addplot+[no markers] {20-500*\ln(0.998*exp(-x)+0.002+0*exp(x))-500*\ln(0.998*exp(x)+0.002+0*exp(-x))};
\end{axis}
\end{tikzpicture}
\end{document}

我得到的错误是 "Undefined control sequence.\foreach ...reach\let \pgffor@assign@before@code=[好多]"

当我把函数替换成简单的exp(x)时,绘图就可以了。那么这个更复杂的函数有什么问题呢?

谅谅

latex pgf
1个回答
0
投票

在公式中使用的对数函数为 ln\ln

\documentclass[11pt]{amsart}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[domain=0:3,samples=100,yticklabels=\empty]
\addplot+[no markers] {20-500*ln(0.998*exp(-x)+0.002+0*exp(x))-500*ln(0.998*exp(x)+0.002+0*exp(-x))};
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.