Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • i simply removed [\forcol] and the plot showed. but it has a lot of points in it. Commented Mar 28, 2016 at 14:40
  • 1
    @riddleculous: It can be really complicated with \expandafters, in my point of view, in nested \foreach loops and multiple \addplot[\foo,\forbar,\morefoo]{...} Commented Mar 28, 2016 at 14:53
  • 3
    Your and cmhughes code are not the same. You are both expanding the color command (which is needed), but cmhughes also avoid the grouping around the \addplots. I would suggest to use \pgfplotsforeachungrouped in your code too. Commented Mar 28, 2016 at 14:53
  • 1
    @UlrikeFischer: Thanks, I've replaced \pgfplotsforeachungrouped instead of the usual \foreach Commented Mar 28, 2016 at 15:00
  • 1
    @riddleculous: The axis environment defers a lot work to the end (e.g. the generation of the legend), and the addplots are not independant (see e.g. the cycle list, labels, maximum etc), so I would avoid to separate them. Commented Mar 28, 2016 at 15:07