# How to plot mark on every nth point?

I have a long CSV data file:

x,y1,y2...
1,v1,v1...
2,v2,v2...
....


I use pgfplots to plot all the lines. I also want to add mark shapes. But the problem is that the data is too dense, and I have a limited space, so the marks stick together.

I tried:

 \addplot[blue, thin, mark=square, each nth point=20] table ...


But it also skipped the data points.

I want to have a smooth line, but only a few marks. How can I do that?

• You need mark repeat key sya mark repeat=10 will repeat marks once in ten. – user11232 Apr 21 '15 at 4:11

You need to use mark repeat key to repeat marks at frequent intervals. mark phase will tell at which point the marks should start. For example,

make repeat = r,
mark phase = p


will put the mark first at pth point and then at p+r th and then p+2rth point etc. An example from the manual

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{tikzpicture}
\begin{axis}[title=Without \texttt{mark repeat}]