Menu

#233 [manual] `/pgfplots/boxplot/data filter/.code` not documented

v1.0 (example)
closed-fixed
5
2020-01-16
2020-01-16
No

As @Schrödinger'sCat has mentioned in one of his answers on TeX.SX (tex.stackexchange.com) the key /pgfplots/boxplot/data filter/.code is not documented in the manual.

He suggested via email to add the following to the manual at the end of section 5.12.2. I suggest to add it after \pgfplots/boxplot/data={<expression>} in section 5.12.1.

\begin{pgfplotskey}{/pgfplots/boxplot/data filter/.code={\marg{code}} (initially empty)}
    Allows the user to install a filter. This filter works very similarly to
    the other filters.
    %
\begin{codeexample}[]
\pgfplotsset{
    only if/.style args={entry of #1 is #2}{
        /pgfplots/boxplot/data filter/.code={
            \edef\tempa{\thisrow{#1}}
            \edef\tempb{#2}
            \ifx\tempa\tempb
            \else
                \def\pgfmathresult{}
            \fi
        }
    }
}

\begin{filecontents*}{data.dat}
v,set
0.1,a
0.2,a
0.3,a
0.8,b
0.9,b
1.0,b
\end{filecontents*}

\begin{tikzpicture}
\begin{axis}[
    boxplot,
    table/col sep=comma,
    table/y=v,
    boxplot/draw direction=y,
]
    \addplot table [only if={entry of set is a}]
        {data.csv};
    \addplot table [only if={entry of set is b}]
        {data.csv};
\end{axis}
\end{tikzpicture}
\end{codeexample}
    %
\end{pgfplotskey}

Discussion

  • Stefan Pinnow

    Stefan Pinnow - 2020-01-16
    • status: open --> closed-fixed
     
MongoDB Logo MongoDB