3

Graphic

The following MWE shows a figure with all identical axis markers (because the scale is too narrow). The option xtick has not "high enough precision".

enter image description here

MWE Code

I did not find a suiting example in the pgfplots package manual - maybe I did not read/think long enough... I am not sure what option should be entered in the axis environment.

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}
\begin{tikzpicture}
\begin{axis}[every minor tick]
\addplot coordinates{(0.999,2e-2) (1.001,12) };
\end{axis}
\end{tikzpicture}

\end{document}

Similar (but different) questions

4

Based on Umz's comment, the following code solves the problem.

\documentclass[margin=2mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}
\begin{tikzpicture}
\begin{axis}[every minor tick,
  x tick label style={
    /pgf/number format/.cd,
    fixed,
    fixed zerofill,
    precision=4
  }]
\addplot coordinates{(0.999,2e-2) (1.001,12) };
\end{axis}
\end{tikzpicture}

\end{document}

enter image description here

| improve this answer | |

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.