2

I have the following semi-logarithmic plot (y-axis() that has the ticks with 10 raised to non-integer powers as shown in figure.

enter image description here

I have referred to both these answers [1,2]. However, both failed to get the real decimal notation in this case (0.16, 0.20, 0.25) instead show (10^−0.8, 10^−0.7, 10^−0.6). The answers in [1,2] work for other values as shown in the second plot in MWE.

How can I remove 10^(−n) notation for values less than 1?

MWE

\documentclass{minimal}
\usepackage{pgfplots}


\begin{document}
\begin{tikzpicture}
\begin{semilogyaxis}[
      scaled y ticks = false,
      y tick label style={/pgf/number format/fixed,
      /pgf/number format/1000 sep = \thinspace % Optional if you want to replace comma as the 1000 separator 
      }]
  \addplot coordinates {
  (100,0.200001)
  (200,0.200003)
  (300,0.200005)
  };    
\end{semilogyaxis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{semilogyaxis}[
      scaled y ticks = false,
      y tick label style={/pgf/number format/fixed,
      /pgf/number format/1000 sep = \thinspace % Optional if you want to replace comma as the 1000 separator 
      }]
  \addplot coordinates {
  (100,0.0200001)
  (200,10.200003)
  (300,110.200005)
  };    
\end{semilogyaxis}
\end{tikzpicture}

\end{document}

1 Answer 1

2

like this:

enter image description here

\documentclass{minimal}
\usepackage{pgfplots}

\begin{document}
    \begin{tikzpicture}
\begin{semilogyaxis}[
      scaled y ticks = false,
      log ticks with fixed point,  % <---- added (replace your "y tick label style"
                   ]
  \addplot coordinates {
  (100,0.200001)
  (200,0.200003)
  (300,0.200005)
  };
\end{semilogyaxis}
    \end{tikzpicture}
    \begin{tikzpicture}
\begin{semilogyaxis}[
      scaled y ticks = false,
      log ticks with fixed point,  % <---- added (replace your "y tick label style"
                    ]
  \addplot coordinates {
  (100,0.0200001)
  (200,10.200003)
  (300,110.200005)
  };
\end{semilogyaxis}
    \end{tikzpicture}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .