[Tex/LaTex] PGFPlots: Axis dashed

pgfplots

How to configure axis dashed on PGFPlots?

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

enter image description here

Best 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}

enter image description here