Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How to configure axis dashed on PGFPlots?

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

enter image description here

share|improve this question
add comment

1 Answer

up vote 11 down vote accepted

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

share|improve this answer
3  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.