你好,我需要从轴上删除 *10^4,并将点改为 10000,20000,30000,而不是 1*10^4、2*10^4...
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=10,
ymin=0,ymax=30000,
axis x line=bottom,
axis y line=left,
axis line style=-,
xlabel={$x$},
ylabel={$y$},
ytick={0,10000,20000,30000},
xmajorgrids=true,
ymajorgrids=true,
grid style= dashed
]
\addplot expression[domain=0:10]{(26000*e^(-0.2*x))+(3000*e^(-0.4*x))+1000};
\end{axis}
\end{tikzpicture}
\end{document}
答案1
您可以使用scaled ticks = false
:
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=10,
ymin=0,ymax=30000,
axis x line=bottom,
axis y line=left,
axis line style=-,
xlabel={$x$},
ylabel={$y$},
ytick={0,10000,20000,30000},
xmajorgrids=true,
ymajorgrids=true,
grid style= dashed,
scaled ticks = false, % <=== add this
]
\addplot expression[domain=0:10]{(26000*e^(-0.2*x))+(3000*e^(-0.4*x))+1000};
\end{axis}
\end{tikzpicture}
\end{document}