2

I would like to have on the x-Axis less ticks and they should be shown with 10^(-x). For example: 0.016 , 0.021 and so on. What is the easiest way? (I hope I did not miss a prior thread with the same question :-( )

\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}

Thank you in advance.

1

Something like this?

\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}

enter image description here

  • Almost perfect. I would like to have 0.02 instead of 2*10^(-2) and so on. Thank you for your assistence – user34047 Oct 30 '18 at 10:18
  • @user34047 I made an update. – user121799 Oct 30 '18 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.