Re: [Pgfplots-features] Filter data before plotting
Brought to you by:
cfeuersaenger,
ludewich
|
From: Florian L. <mai...@xg...> - 2018-10-29 13:26:22
|
Hey,
unfortunately I got to walk away from using pgfplots like that again. It's just to slow.
I have a document with nothing but 2 groupplots with 2 graphs and 4 or 5 addplots each.
All are plot from the same CSV file with 3600 lines, which is filtered by 3 onlyif commands to 50 data points per addplot.
On my machine pdflatex on that documents take 95s. (CPU is i5 @ 1.9 GHz, SSD).
So I will split up data in chunks of CSV files before plotting.
Best,
Florian
Am 25.10.18 um 10:13 schrieb Florian Lindner:
> Hi,
>
> ok, I see the issue.
>
> One other thing. I get tons of messages like
>
> NOTE: coordinate (0.6,0.1) has been dropped because it is unbounded (in x). (see also unbounded coords=jump).
>
> I added filter discard warning=false, so the log output is not cluttered so much:
>
> \pgfplotsset{
> only if/.style 2 args={
> filter discard warning=false,
> x filter/.append code={
> \edef\tempa{\thisrow{#1}}
> \edef\tempb{#2}
> \ifx\tempa\tempb
> \else
> \def\pgfmathresult{NaN}
> \fi
> },
> },
> }
>
> (so this message was less of a question, more of documentation)
>
> Best Regards,
>
> Florian
>
>
>
> Am 24.10.18 um 20:29 schrieb Stefan Pinnow:
>> Hi Florian,
>>
>> I think there was already a discussion about an inclusion of such a feature. I
>> think the conclusion was that it is not a trivial task, because the elements
>> to filter could be of numerical or non-numerical type, and the data could come
>> from a table with and without headers. And many, many more things need to be
>> considered.
>>
>> Thus I don't have much hope that Christian -- the developer -- will find a
>> "global" solution to this problem in the near future. But to keep track of
>> that, consider adding a feature request to the PGFPlots Tracker
>> <https://sourceforge.net/p/pgfplots/feature-requests/>
>> if there isn't already one in for that feature.
>>
>>
>> Best regards,
>> Stefan
>>
>>
>>> -----Original Message-----
>>> From: Florian Lindner [mailto:mai...@xg...]
>>> Sent: Wednesday, October 24, 2018 5:34 PM
>>> To: Stefan Pinnow
>>> Cc: pgf...@li...
>>> Subject: Re: [Pgfplots-features] Filter data before plotting
>>>
>>> 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:mai...@xg...]
>>>>> Sent: Tuesday, October 23, 2018 11:10 AM
>>>>> To: pgf...@li...
>>>>> 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
>>>>> Pgf...@li...
>>>>> https://lists.sourceforge.net/lists/listinfo/pgfplots-features
>>>>
>
>
> _______________________________________________
> Pgfplots-features mailing list
> Pgf...@li...
> https://lists.sourceforge.net/lists/listinfo/pgfplots-features
>
|