# ytick pgfplot issue

I have the following latex code but unfortunately cannot get the ytick to be of my choice.

\documentclass{article}

\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}

\begin{center}
\begin{tikzpicture}
\begin{axis}[
xlabel=Trail Run \#,
xtick={0, 4, 8, 12, 16, 20},
ytick={0, 1, 2, 3, 4, 5, 6},
legend style={
at={(0.5,0.5)},
anchor=center}]

plot coordinates {
(1, 5.372137)
(2, 5.401571)
(3, 5.418153)
(4, 5.409281)
(5, 5.440709)
(6, 5.425516)
(7, 5.366961)
(8, 5.392147)
(9, 5.345825)
(10, 5.366253)
(11, 5.320773)
(12, 5.373887)
(13, 5.338346)
(14, 5.322246)
(15, 5.399925)
(16, 5.349757)
(17, 5.345629)
(18, 5.336819)
(19, 5.364673)
(20, 5.402730)
};

plot coordinates {
(1, 4.349543)
(2, 4.348597)
(3, 4.349540)
(4, 4.348221)
(5, 4.344659)
(6, 4.350545)
(7, 4.345121)
(8, 4.337458)
(9, 4.344044)
(10, 4.349293)
(11, 4.344615)
(12, 4.349939)
(13, 4.346299)
(14, 4.341717)
(15, 4.345412)
(16, 4.351933)
(17, 4.351421)
(18, 4.338126)
(19, 4.345590)
(20, 4.348072)
};
\end{axis}
\end{tikzpicture}
\end{center}

\end{document}


In this case I've specifically changed the legend's position which I didn't really want to. I want the legend to be on south east (which I can do) but I want the ytick to be more like — {0, 1, 2, 3, 4, 5, 6} so I've both the graphs near each other and make terminal '0' as the reference.

Any thoughts?

-
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Benedikt Bauer Feb 21 '13 at 22:34
Hi; I've added the required lines of code. Also, added the 'ytick' line of code that I'm having issues with. Thanks. –  p0lAris Feb 21 '13 at 22:37
Are you perhaps looking for ymax=6, ymin=0? –  Peter Grill Feb 21 '13 at 22:39
Wow! So trivial. Thank you very much. –  p0lAris Feb 21 '13 at 22:53
Since you really want to control the min and max y values, then you need to set them ymax=6, ymin=0. Adding these options yields: