4

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

1

1 Answer 1

5

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

You must log in to answer this question.

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