In the code below, how do I go about removing all the enteries where the y1 AND y2 value = 0? Thanks for your help.
Here is the original code that was masterfully written by Stefan Pinnow found here:
\documentclass[border=2mm]{standalone}
\usepackage{pgfplots}
\usepackage{filecontents}
\begin{filecontents*}{data.csv}
Iter, y1, y2
1, -0.9317521, -1.5
2, 1.8946202, 1.8946202
3, 0, 0
4, 0, 1.5797030
5, -1.8814457, -1.8814457
6, 0, 0
7, 2.0373926, 0
8, 0, 0
9, 1.9972528, 1.9972528
10, 0, 0
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=0,
xmax=11,
xlabel=Number~of~Recursions,
ylabel=Absolute Parameter Error,
]
\addplot [
mark=*,
only marks,
mark options={
%%% only draw the marker
% draw=color, fill=none
draw=red,
fill=red,
% adjust the line width of the marker
line width=1pt,
}
] table [x=Iter,y=y2,col sep=comma] {data.csv};
\addplot [
ycomb,
mark=*,
blue,
fill=blue,
line width=1pt,
% make marker smaller
mark options={
scale=.5,
}
] table [x=Iter,y=y1,col sep=comma] {data.csv};
\addplot [
blue,
sharp plot,
line width=1pt,
] coordinates {
(\pgfkeysvalueof{/pgfplots/xmin},0)
(\pgfkeysvalueof{/pgfplots/xmax},0)
};
\end{axis}
\end{tikzpicture}
\end{document}
