# Remove tick marks on only one axis in 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,
]
\end{axis}
\end{tikzpicture}
\end{document}


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,
]
\end{axis}
\end{tikzpicture}
\end{document}


Use ytick=\empty in the axis options (worked in pgfplots 1.12.1):

Found the solution here.

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ytick=\empty
]
\end{axis}
\end{tikzpicture}
\end{document}

• But this removes both the tick marks and the tick labels, which may or may not be desired. The answer by Torbjørn allows removal of the tick marks but keeping the labels. – Mårten W Mar 23 '19 at 10:34