# PGFPlots: Axis dashed

How to configure axis dashed on PGFPlots?

\begin{axis}[grid=major]
%need grid=dashed
\end{axis}


-

## 1 Answer

You can use the grid style option (for each grid line), or major grid style (for each major grid line):

\documentclass{article}
\usepackage{pgfplots}

\pgfplotsset{grid style={dashed}}

\begin{document}

\begin{tikzpicture}
\begin{axis}[grid=major]
%
\end{axis}
\end{tikzpicture}

\end{document}


-
If you only want to activate the dashing of the grid on a per-plot basis, then you can put the command in the axis command, i.e. \begin{axis}[grid=major,grid style={dashed}]. – qubyte Nov 23 '11 at 6:06