2

I'd like to skipp one single datapoint from my data and have found no clue on how to manage it. Has any of you an idea? The datapoint is incorrect but if I simply delete it, the datafile tells me, that the amount of datapoints in a row shouldn't be changed.

\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}
\pgfplotstableread{data.txt}
\datatable
\addplot table[y = a] from \datatable ;
\addplot table[y = b] from \datatable ;
\addplot table[y = c] from \datatable ;
\end{axis}
\end{tikzpicture}
\end{figure}
Coira
  • 21
  • Please next time try to provide a MWE with everything needed like in my answer. (Use filecontents for separate files and start from \documentclass{} to end at \end{document} command) – koleygr Sep 13 '17 at 12:07

1 Answers1

2

You can use skip coords between

\documentclass{article}
\usepackage{pgfplots}
\usepackage{filecontents}
\begin{filecontents*}{data.txt}
x a b c d
1 .1 .4 .5 .1
3 .2 .3 .1 .5
5 .3 .5 .6 .1
7 .4 .1 .5 .9
8 .5 .3 .4 .7
9 .6 .6 .7 .3
\end{filecontents*}


\begin{document}
\begin{tikzpicture}
\begin{axis}
\pgfplotstableread{data.txt}
\datatable
\addplot table[x=x,y = a] from \datatable ;
% Removing  4th point from next plot (index starts from 0 -So stoping at 4th(index=3) continue from 5th(index=4)-)
\addplot table[y = b, skip coords between index={3}{4}] from \datatable ;
\addplot table[y = c] from \datatable ;
\end{axis}
\end{tikzpicture}
\end{document}

The output will be like this:

enter image description here

Answer from here: Remove data points without changing the original table.

Your question is different because you can access the datatable but the way I suggest to do it is by not changing it.

koleygr
  • 20,105