# Use markers as clip path

I want to plot a line, where the markers knock out a piece of the line instead of being displayed (it would be useful if there was a way to leave a bit of space around a marker, too). Drawing the marks white doesn't always work, i.e. when anything is behind the plot.

Is there a way to add the markers to the plot's clip path, so it will be transparent in the knocked-out parts instead of white?

\documentclass{minimal}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[height=3cm, width=10cm]
samples=10] {x};
\end{axis}
\end{tikzpicture}
\end{document}


• Markers are not destructive in the sense that they don't remove the parts of the plot they are placed on. They are overdrawn so they can't remove a part of the path unless a certain decoration or something similar is utilized. Also you need \usetikzlibrary{plotmarks} in your MWE. – percusse Apr 13 '13 at 18:53

Perhaps it would be possible if support for \addplot[clip] was added (would be a feature request).