# pgfplots: minor ticks starting at 1.5, not 0.5

The following code is used to produce the plot below.

\pgfplotsset{
axis equal image,
xtick={1,2,3,4},
ytick={1},
minor y tick num={1},
minor x tick num={1},
xmin=-0.3,
xmax=4.2,
ymin=-0.3,
ymax=2.2,
axis x line=middle,
axis y line=middle,
axis equal image,
xlabel=$t$,
every axis plot/.append style={line width=1pt}
}

(...)

\begin{tikzpicture}
\begin{axis} [ylabel=$s_6(t)$]
\end{axis}
\end{tikzpicture}


Now I wonder why there is no 0.5 tick, neither at the X, nor the Y axis. I know that I can manually add them, but then there will be captions as well (which I don't like). Can anyone help me out to explain what wrong assumptions I made or which pitfall I ran into?

-
Instead of providing the complete tick list explicitly, you can also use xtick={0,...,4}, which will fill in the numbers using a step of 1. If you want a different step size, you can specify the first two numbers in the series, e.g. xtick={0,5,...,50} would give you the numbers 0, 5, 10, 15 etc. –  Jake Aug 20 '12 at 7:03
@Jake, thank you for the hint -- indeed this makes the code more pretty. –  wal-o-mat Aug 20 '12 at 9:11

Add zero to your tick list such that minor ticks can be added between two tick points.

\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis equal image,
xtick={0,1,2,3,4},
ytick={0,1},
minor y tick num={1},
minor x tick num={1},
xmin=-0.3,
xmax=4.2,
ymin=-0.3,
ymax=2.2,
axis x line=middle,
axis y line=middle,
xlabel=$t$,
ylabel=$s_6(t)$]
\end{axis}
\end{tikzpicture}
\end{document}


-
Thank you! This (a) works and (b) makes sense for me. –  wal-o-mat Aug 20 '12 at 10:44
@wal-o-mat My pleasure. –  percusse Aug 20 '12 at 20:27