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

I got a nice an d tidy plot with the help of pgfplot using groupeplot. Now I want to insert some extra ticks with different color than the major grid...everything works pretty well except the color line of the grid...I know extra ticks are treated as major ticks and for those

 major grid style = {red}

would change the color. But I can't find something like

 extra grid style = {red}

in the manual. All I can actually find is

 extra tick line style={red}

which only changes the color of the label entry of the extra tick. Does anybody knows a tiny and beautiful workaround?

Thank in advance, CN

share|improve this question
up vote 5 down vote accepted

All the options that apply to ticks and grids can be specified separately for extra ticks by putting the options in extra tick style={...}. So if you want the major grid lines for the extra ticks to be red, you would set extra tick style={major grid style=red}:


    extra x ticks={1,3},
    extra tick style={
        major grid style=red,
        tick align=outside,
        tick style=red
\addplot [black, only marks] {rnd};
share|improve this answer
Thanks Jake, for this pretty fast and correct answer...So I was pretty close but still miles away..damn ;) – CN19 Jul 6 '13 at 12:13
@user33304: it is better to accept the answer followed by up voting. – kiss my armpit Jul 6 '13 at 12:26
thanks for the advise...but upvoting requires a registration..and that's what it did right now ;) – CN19 Jul 6 '13 at 13:02

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.