From 8ba7124f62965c3e0ed36aba3712e457eff8c8b3 Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Wed, 25 Jan 2023 02:53:55 +0100 Subject: [PATCH] Added pgfplots filter 'discard if gt' --- latex/presentations/midterm/presentation.tex | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/latex/presentations/midterm/presentation.tex b/latex/presentations/midterm/presentation.tex index 233c1b3..6090b66 100644 --- a/latex/presentations/midterm/presentation.tex +++ b/latex/presentations/midterm/presentation.tex @@ -140,9 +140,10 @@ \AtBeginSubsubsection[]{} \AtBeginSubsection[]{} + \pgfplotsset{ discard if/.style 2 args={ - x filter/.code={ + x filter/.append code={ \edef\tempa{\thisrow{#1}} \edef\tempb{#2} \ifx\tempa\tempb @@ -151,7 +152,7 @@ } }, discard if not/.style 2 args={ - x filter/.code={ + x filter/.append code={ \edef\tempa{\thisrow{#1}} \edef\tempb{#2} \ifx\tempa\tempb @@ -159,6 +160,15 @@ \def\pgfmathresult{inf} \fi } + }, + discard if gt/.style 2 args={ + x filter/.append code={ + \edef\tempa{\thisrow{#1}} + \edef\tempb{#2} + \ifdim\tempa pt > \tempb pt + \def\pgfmathresult{inf} + \fi + } } }