TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to configure axis dashed on PGFPlots?

%need grid=dashed

enter image description here

share|improve this question
up vote 12 down vote accepted

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


\pgfplotsset{grid style={dashed}}




enter image description here

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

Your Answer


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.