# Change the color of ticks in pgfplots

How do I set the color of the tick marks (major and minor) in pgfplots? It seems like a very basic question, but I cannot find it in the instructions. I would like to have black tick marks instead of the standard gray.

-

\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[every x tick/.style={red}, minor x tick num=1]
\end{axis}
\end{tikzpicture}

\end{document}


Like this. You will finde all those styles for any element which can be adressed in the pgfplots manual. Those style btw will expand to every tick (x,y, and z) when you strip the x. Result (detail):

Upon request: global options:

\documentclass[border=2mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{every  tick/.style={red,}, minor x tick num=1,}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}
\end{document}


Every option which is set in \pgfplotsset will be present in any axis environment. See manual page 54 for details. Within this environment it's also possible to define own styles.

-
+1 could you demonstrate how to use pgfplotsset in the preamble to apply it globally (just in case the OP wants this) –  cmhughes Oct 15 '12 at 16:24
\begin{axis}[
x tick style={color=black}
]


Include the above line, x tick style={color=black}, in the argument list for \begin{axis}.

-