我想绘制一个函数。但是gnuplottex
和的结果gegogebra
不同。错误在哪里?
\documentclass{standalone}
\usepackage[miktex]{gnuplottex}
\usepackage{pgfplots}
\pgfplotsset{compat = newest}
\newcommand*\GnuplotDefs{
set samples 50;
dexp(x,l) = l * exp(-l*x);
dweibull(x,a,b) = (a/b) * ((x/b)**(a-1)) * exp(-(x/b)**a);
kexpweibull(x,l,a,b,p) = p * dexp(x,l) + (1-p) * dweibull(x,a,b);
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ymin=0,
ymax=0.1,
no markers,
smooth,
every axis plot post/.append style={very thick},
xlabel={x},
ylabel={probability density},
]
\addplot gnuplot [raw gnuplot] {
\GnuplotDefs
plot [x = 0:25] kexpweibull(x,0.2,5,15,0.2);
};
\end{axis}
\end{tikzpicture}
\end{document}