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 use the following command to plot data from a file using pgfplots.

\addplot table [x expr=\coordindex+1,y index=0]{file.txt}

I have around 8 curves in the same plot and lot of data points in the files that when I plot the graph, the graph is very thick and the different curves cannot be distinguished from each other. As a solution, how to make the marker appear only on every n points?

share|improve this question
up vote 10 down vote accepted

You can use mark repeat={<integer>}, where the positive <integer> causes to draw only each n-th mark. A little example:

dof L2
5   8.31160034e-02
17  2.54685628e-02
49  7.40715288e-03
69  2.10192154e-03
71  5.87352989e-04
92  1.62269942e-04


ylabel=$L_2$ error]
\addplot table[x=dof,y=L2] {mytable.dat};

ylabel=$L_2$ error,
mark repeat={2}]
\addplot table[x=dof,y=L2] {mytable.dat};


enter image description here

share|improve this answer

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.