[Tex/LaTex] PGFPlots how can I hide extra y tick marks

pgfplots

simple question (I hope)

Using pgfplots 1.5.1, miktex 2.9 on Windows 7 32 bits. I'd like to hide the tick marks at the right and top side of the plot, but without losing the lines (e.g. keep the plot axis style as box but only keep tick marks in the left y axis and bottom x axis, keeping the lines in the upper x axis (without tick marks nor labels) and right y axis (without tick marks nor labels)

If i use ytick=\empty it removes all of the labels and ticks, but I don't want that, I just want the extra y and x ticks removed.

So far I've tried:

every extra y tick = \empty,
every extra y tick/.style={\empty},
extra y ticks={},
extra ytick =\empty, 
hide extra y ticks,
extra y tick style={tickwidth=0cm,major tick length=0cm},

But no luck,

Any help is much appreciated.

Best regards,

(edit: Forgot to add I'm using Latex->PDF profile)

Best Answer

The position of the tick marks is set using the key tick pos=<left|right|both> for the x and y axis simultaneously, and xtick pos and ytick pos to set the tick marks separately. In your case, you want to set ytick pos=left.

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[ytick pos=left]
\addplot {rnd};
\end{axis}
\end{tikzpicture}
\end{document}

The extra y tick options refer to something different: You can manually add additional tick positions, "extra ticks", to highlight certain positions. You specify where to add new tick positions using extra y ticks={<list>}, and set the styles for these extra ticks using extra y tick style=<options>. Here's an example, highlighting the y position 0.5, which ordinarily doesn't get a tick mark:

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
    ytick pos=left,
    extra y ticks={0.5},
    extra y tick style={red, yticklabel pos=right,ytick pos=right}]
\addplot {rnd};
\end{axis}
\end{tikzpicture}
\end{document}