更改 x 轴的格式

更改 x 轴的格式

我希望 x 轴上的刻度更少,并且应显示为 10^(-x)。例如:0.016、0.021 等等。最简单的方法是什么?(我希望我没有错过之前有相同问题的帖子 :-( )

\documentclass[letter,12pt,twoside,border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}

\begin{tikzpicture}[
  labelnode/.style={font=\footnotesize, above},
  labelline/.style={stealth-stealth,shorten >=0.1pt, shorten <=0.5pt}
]
\begin{axis}[
    axis lines = left,
    width=16cm,
    height=6cm,
    clip mode=individual,
    scaled x ticks = false,
    x tick label style={/pgf/number format/fixed}
    ]

\addplot [
    domain=25/1604:25/1359, 
    samples=100, 
    color=red     ] {-5+1/4/x+20} ;

\addplot [
    domain=25/1359:25/816, 
    samples=100, 
    color=red     ] { 1/6/x+20};

\addplot [
    domain=25/816:0.051, 
    samples=100, 
    color=red   ] {3+1/8/x+20};

\coordinate (l) at (rel axis cs:0,1);


\end{axis}
\end{tikzpicture}
\end{document}

先感谢您。

答案1

像这样吗?

\documentclass[letter,12pt,twoside,border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}

\begin{tikzpicture}[
  labelnode/.style={font=\footnotesize, above},
  labelline/.style={stealth-stealth,shorten >=0.1pt, shorten <=0.5pt}
]
\begin{axis}[
    axis lines = left,
    width=16cm,
    height=6cm,
    clip mode=individual,
    scaled x ticks = false,
    xtick={0.016,0.021,...,0.051},
    x tick label style={/pgf/number format/fixed,
    /pgf/number format/precision=3}
    ]

\addplot [
    domain=25/1604:25/1359, 
    samples=100, 
    color=red     ] {-5+1/4/x+20} ;

\addplot [
    domain=25/1359:25/816, 
    samples=100, 
    color=red     ] { 1/6/x+20};

\addplot [
    domain=25/816:0.051, 
    samples=100, 
    color=red   ] {3+1/8/x+20};

\coordinate (l) at (rel axis cs:0,1);


\end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容