From ac0e3262fb027e4ab586204bf2d5a05e9a831933 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sat, 2 Jun 2018 23:42:05 +0200 Subject: 2018-06-02 22:41:00 --- metapost/context/base/mpiv/mp-grap.mpiv | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'metapost') diff --git a/metapost/context/base/mpiv/mp-grap.mpiv b/metapost/context/base/mpiv/mp-grap.mpiv index e799f629c..0299c0587 100644 --- a/metapost/context/base/mpiv/mp-grap.mpiv +++ b/metapost/context/base/mpiv/mp-grap.mpiv @@ -266,19 +266,27 @@ enddef ; graph_margin_fraction.low=-.07 ; % bbox fraction for default range start graph_margin_fraction.high=1.07 ; % bbox fraction for default range stop +%def graph_with_pen_and_color(expr q) = +% withpen penpart q +% withcolor +% if colormodel q=1 : +% false +% elseif colormodel q=3 : +% (greypart q) +% elseif colormodel q=5 : +% (redpart q, greenpart q, bluepart q) +% elseif colormodel q=7 : +% (cyanpart q, magentapart q, yellowpart q, blackpart q) +% fi +% withprescript prescriptpart q +% withpostscript postscriptpart q +%enddef ; + def graph_with_pen_and_color(expr q) = - withpen penpart q withcolor - if colormodel q=1 : - false - elseif colormodel q=3 : - (greypart q) - elseif colormodel q=5 : - (redpart q, greenpart q, bluepart q) - elseif colormodel q=7 : - (cyanpart q, magentapart q, yellowpart q, blackpart q) - fi + withproperties q enddef ; + % Add picture component q to picture @# and change part p to tp, % where p is something from q that needs coordinate transformation. % The type of p is pair or path. -- cgit v1.2.3