The standard pgfplots
notation for tick labels is without final zeros when no needed but the standard one for scientific papers is to have all ticks with the same number of digits after the dot a part for the 0 that is often print simply as 0
.
I am able to set the same precision for all ticks but I would like to print the 0
simply as 0
and not for example 0.0
, how can I do that?
The first image is the pgfplots
default, the second one is what I am able to do and the third is what I desire to do.
Minimal code for the second image
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis} [ymin=0, ymax=2,
xmin=0.2, xmax=2,
y tick label style={
/pgf/number format/fixed,
/pgf/number format/fixed zerofill,
/pgf/number format/precision=1},
]
\addplot[only marks] {x};
\end{axis}
\end{tikzpicture}
\end{document}
0
and0.0
.c=0.0
implies that the true value could also be0.04
or-0.03
, whilec=0
implies that the true value could also be0.2
or-0.4
. This is not as relevant for axis labels, though, where you're basically free to do whatever looks good. If you're interested in this topic, have a look at John Denker's "Measurement and Uncertainties", where the reasoning and pitfalls of the "sig figs" approach are discussed0
and0.0
I agree with you: it is not so relevant for axis labels.. in addition I am plotting defined functions and not data with uncertainty so in my case it is not relevant at all. For the published example I don't find anything, except in my PhD supervisor's articles... He says to do this because it is commonly done but now I see that it's not true :-) Anyway, if there is a way of doing it, good, if there is not I will point out the situation to him