I found very strange that the points in the first quadrant of the first picture in https://tex.stackexchange.com/a/310508/132405 are not aligned with the origin point (the red line doesn't pass by the red dot):
The code (from Torbjørn T.) is:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis} [
axis lines = {center},
width = {0.6\linewidth},
ylabel = {$y$},
xlabel = {$x$},
ytick distance = {2},
minor y tick num = {1}
]
\addplot [
mark = x, domain= -3:4
]
{abs(x)};
\end{axis}
\end{tikzpicture}
\end{document}
This code is correct, but shows the bug.
If we look carefully, we see that the distance in the y-axis between 0 and 1 is smaller than the distance between 1 and 2 or between 2 and 3 on the y-axis: see the lime lines in the next picture (all have the same height):
With a zoom on origin:
The dots (x marks) must be on the brown line.
Is there a workaround? I read at https://github.com/pgf-tikz/pgfplots/issues/400#issuecomment-893904915 that the maintainer is almost inactive.
In the wait of the correction of the package, how can we known when this severe bug occurs (for a plotting tool, it's a severe bug) and what to use instead?
Bug opened on https://github.com/pgf-tikz/pgfplots/issues/423.





ymin=0. – Torbjørn T. Jan 13 '22 at 14:53\node at (axis cs:1,1) {\pgfkeysvalueof{/pgfplots/ymin}};just before\end{axis}to see whatyminactually is. – Torbjørn T. Jan 13 '22 at 14:55ymin=0when with the plotting of the function y=x, we don't have to do it (function plotted between 0 and 4 for example)? – quark67 Jan 13 '22 at 14:57domain=-3:4,samples=29. – Henri Menke Jan 13 '22 at 15:02pgfplotsconcludes you do not need 0 in the y range and the x-axis is not at y=0. – Rmano Jan 13 '22 at 15:06axis lines=centerimpliesenlargelimits=false, which in turn means no extra space is added inside the axis. Ifaxis lineshad been replaced bygridin the original code, the confusion wouldn't have happened in the first place I think, because 0 would be in the y-range. – Torbjørn T. Jan 13 '22 at 15:49samples at={-3,0,4}instead ofdomain... – Stefan Pinnow Jan 13 '22 at 16:43