I would like to know how could I exclude 0 of this axis format

yticklabel style={/pgf/number format/.cd,sci,sci zerofill,precision=1}

In order to avoid this.

enter image description here

the most similar what I've got is using this code (as MWE)




\begin{axis}[grid=major, scaled ticks=false,scale=2.2, y post scale=2, yticklabel style={/pgf/number format/.cd, 1000 sep={\;}}]
        only marks,
        error bars/.cd,
        x dir=both, x explicit,
        y dir=both, y explicit,
        table[y error=yerror,x error=xerror]
        ] {-120322.13*x + 53246.18};  

Which produces this

enter image description here

being this NmP3pgf1.dat

x           y                xerror       yerror  label
0.00        52080.65         0.01         648.31   a
-0.80       148381.84        0.01       2618.50   a
-2.80       391752.88        0.01       9554.95   a

Essentially Jake's solution is correct as usual but here your numbers are too big for the \ifdim test. Hence a bit more lower level pgf number formatting is needed.

If you just use the following it will perform a test for zero and execute the correct branch of the if.

        \pgfmathprintnumber[sci,sci zerofill,precision=1]{\tick}%

enter image description here

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.