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 noticed that when using pgfplots to make plots without specifying style, it automatically assigns the same color and line style to the first input and fifth input, which means the two curves would have the same style...

Any way to avoid that?

share|improve this question
up vote 23 down vote accepted

While the first and fifth plot have the same line colour, the marks are different. However, this might not be enough distinction for your application, e.g. if you don't use markers.

In that case, you can choose from one of the other cycle list names, which are described starting on p. 142 of the pgfplots documentation.

For example, if you set the option cycle list name=exotic for the axis, the first five plots would look like this:

pgpflots with "exotic" cycle list

You can also define your own cycle lists, using

{<first style>},
{<second style>},

Here's an example of a plot style based on the color scheme "Blues" from the Colorbrewer website. For the fifth plot, the color is overridden using the optional argument to \addplot:

plot with custom cycle list


\definecolor{blues1}{RGB}{198, 219, 239}
\definecolor{blues2}{RGB}{158, 202, 225}
\definecolor{blues3}{RGB}{107, 174, 214}
\definecolor{blues4}{RGB}{49, 130, 189}
\definecolor{blues5}{RGB}{8, 81, 156}


    cycle list name=colorbrewer-blues,
    no markers,
    every axis plot/.append style=thick]
\addplot {rnd*.5-.25};
\addplot {rnd*.5-0.5};
\addplot {rnd*.5-0.75};
\addplot+[orange,very thick]{rnd*.5+x*0.05-0.75};
share|improve this answer
my bad it's pretty obvious in the documentation, I just didn't find it. – ben paillard Aug 19 '11 at 12:23

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.