Hi Stefan, thanks for that link, works like a charm. I renamed it to "only if" for brevity.
Still, I think that this is a worthy feature for inclusion into pgfplot, don't? Best Thanks, Florian Am 23.10.18 um 17:36 schrieb Stefan Pinnow: > Hello Florian, > > this is already possible with a minor modification of the code. > Have a look at > <https://tex.stackexchange.com/a/342529/95441> > I am pretty sure that this question was also already there for `discard if' > but after a quick search I couldn't find the answer. > > But I think you already know what needs to be done to combine/"append" > filters ;) > > > Best regards, > Stefan > > >> -----Original Message----- >> From: Florian Lindner [mailto:mailingli...@xgm.de] >> Sent: Tuesday, October 23, 2018 11:10 AM >> To: pgfplots-features@lists.sourceforge.net >> Subject: [Pgfplots-features] Filter data before plotting >> >> Hello, >> >> it seems to be common demand to filter data that is to be plotted. >> >> As an example, you have a table: >> >> | h | Model | Testset | Result | >> |-----+-------+---------+--------| >> | 1 | A | X | 0.1 | >> | 0.5 | A | X | 0.2 | >> | 0.2 | A | X | 0.3 | >> | 1 | B | X | 0.11 | >> | 0.5 | B | X | 0.12 | >> | 0.2 | B | X | 0.13 | >> | 1 | B | Y | 0.1 | >> | 0.5 | B | Y | 0.12 | >> | 0.2 | B | Y | 0.1 | >> >> Now you want to plot all results (x = h, y = Result) for Model=B, >> Testset=Y. >> >> There are some code snippets, like: >> >> https://tex.stackexchange.com/questions/66640/how-can-i-filter-select- >> data-float-text-from-a-table-and-plot-it >> https://tex.stackexchange.com/questions/98003/filter-rows-from-a-table >> >> but they only allow to filter for one criteria. >> >> As far as I see, pgfplots already have a number of filtering/restrictions >> possiblilities, but they all act on coordinates only. >> >> Or is there something like \addplot[restrict={Model==B and Testset=Y}, >> x=h, y=Result] {my_data.csv}; ? >> >> What would be the official way of doing that? >> >> Best Thanks, >> >> Florian Lindner >> >> >> >> _______________________________________________ >> Pgfplots-features mailing list >> Pgfplots-features@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/pgfplots-features > _______________________________________________ Pgfplots-features mailing list Pgfplots-features@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pgfplots-features