[Tex/LaTex] Remove tick marks on only one axis in pgfplots

pgfplots

How do you remove the tick marks on only one axis in pgfplots?

In my MWE, you'll notice slightly darker part to the y grid lines where the ticks are. I'd rather just have the grid lines, with no ticks, but also I'd like to keep the ticks on the x-axis. I had previously used tickwidth=0, but that gets rid of the x ticks, too.

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

enter image description here

Best Answer

The drawing style of the y ticks can be changed with ytick style={<options>}, so you can for example do

ytick style={draw=none}

in \pgfplotsset or the axis options to hide them.

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{ytick style={draw=none}}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
    xtick pos=left,
    ymajorgrids=true,
]
\addplot {rnd};
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here