According to the comments from others, this post has been separated into smaller questions from the previous version of this OP.
In the graph below, will you help m
The reason minor.tick
produces 6 intervals is that it was written on the assumption that the default axis divisions would be used. It has no way of knowing that you substituted a different major tick placement.
After each axis(4, ...) call, you should make a call:
box()
I already answered the question yesterday on SO about how to construct a modified version of minor.tick
that could be used with side =3 or =4.