如何更改 Y 轴上的值

如何更改 Y 轴上的值
\documentclass{article}

\usepackage[sc]{mathpazo}
\usepackage{pgfplots,amsmath}
\usepackage{tikz}
\usepackage{tkz-fct,tkz-base}
\usepackage{tkz-tab,tkz-euclide}
 \usepackage[miktex]{gnuplottex}
 \usetikzlibrary{%
 decorations.pathreplacing,%
 decorations.pathmorphing%
 }

 \newlength\figureheight
 \newlength\figurewidth
 \setlength\figureheight{6cm}
 \setlength\figurewidth{6cm}
 \definecolor{mycolor1}{rgb}{0.00000,0.75000,0.75000}%
 \definecolor{mycolor2}{rgb}{0.75000,0.00000,0.75000}%

 \begin{document}
 \centering

\begin{tikzpicture} 
\begin{semilogyaxis}[xmin=0, xmax=1, ymin=0, ymax=1, samples=1000, fill=blue]
  \addplot[black!50,thick ] (x,{exp(-1/2)*(1-exp((-2*x)/0.01))+(1/2)*exp(-1/2)*(1+exp((-2*x)/0.01))+(1/8)*(0.01)exp(-1/2)(1-exp((-2*x)/0.01))});
  \addplot[red,thick ] (x,{exp(-(1/2)+x/2)+((0.01)/8)*(1-x)*exp(-(1/2)+x/2)});
  \addplot[blue,thick ] (x,{-exp(-(1/2)-(2*x)/0.01)+(1/2)xexp(-(1/2)-(2*x)/0.01)+exp(-(1/2)+x/2)+(0.01/8)*(-exp(-(1/2)-(2*x)/0.01)+(1-x)*exp(-(1/2)+x/2))});
\end{semilogyaxis} 
\end{tikzpicture} %
[\epsilon=1000, \quad a_0=1,\quad \omega_0=1] %
[\text{$--$'' pertubasyon \c{c}\"{o}z\"{u}m\"{u},$-$'' n\"{u}merik \c{c}\"{o}z\"{u}m}]
 \end{document}

答案1

假设您想保留 y 轴上的对数缩放比例,但使用ymin=0对数 y 轴则无法实现,因此我将其更改为0.1。我想您想要类似以下示例的内容。我只是手动指定了 sytickyticklabels。这可能不是最优雅的解决方案,但至少有效。

\documentclass{article}
\usepackage{pgfplots} 
\begin{document} 
\begin{tikzpicture} 
\begin{semilogyaxis}[
  xmin=0, xmax=1, ymin=0.1, ymax=1,
  samples=1000,
  fill=blue,
  ytick={0.1,0.2,...,1},
  yticklabels={0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
] 
\addplot[black!50,thick ] 
(x,{exp(-1/2)*(1-exp((-2*x)/0.01))+(1/2)*exp(-1/2)*(1+exp((-2*x)/0.01))+(1/8)*(0.01)*exp(-1/2)*(1-exp((-2*x)/0.01))}); 
\addplot[red,thick ] (x,{exp(-(1/2)+x/2)+((0.01)/8)*(1-x)*exp(-(1/2)+x/2)}); 
\addplot[blue,thick ] (x,{-exp(-(1/2)-(2*x)/0.01)+(1/2)*x*exp(-(1/2)-(2*x)/0.01)+exp(-(1/2)+x/2)+(0.01/8)*(-exp(-(1/2)-(2*x)/0.01)+(1-x)*exp(-(1/2)+x/2))}); 
\end{semilogyaxis} 
\end{tikzpicture} 
\end{document}

enter image description here

相关内容