I saw this question a few days ago:
missing a tick label that has been named
I answered the following, and it got downvoted (3 times), then deleted:
Does this give what you want? xtick = {-3.14, -1.57, ..., 9.42},
Someone gave the following comment 2 days later:
Replacing your xtick={...} with xtick={-3.14,-1.57,...,9.42} works for me (which avoids the rounding errors).
to which the asker replied:
It worked too on me! Thank you so much
I'm trying to understand what caused this huge difference is these two replies.
I know the most probable explanation is that the 3 people saw something bad in my answer, and not in the other comment.
But, reading and re-reading the 2 replies, I can't see it.
For me, the question was clear, the context was clear, and the 2 replies are short, clear and helpful.
So if the difference is in fact so obvious, could anyone explain it to me?
PS:
After reading some advice on how to post a "good" answer, I tried a different approach and edited my deleted answer, but nothing happened (no upvote, no accepted answer, etc.):
TikZ probably just expects two numbers before "...,", in your xtick list, so, giving it three numbers may lead to this unwanted behaviour. The pgfmanual (https://pgf-tikz.github.io/pgf/pgfmanual.pdf) mentions this two-numbers rules for the foreach statement: "If you provide two numbers before the ..., the \foreach statement will use their difference for the stepping"
So maybe this answer had a problem too.