From 59c1e24371c2c9f63586c4c5e323ee64617bf51a Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Wed, 4 May 2016 13:24:44 -0400 Subject: [PATCH] default_kw and force_kw macros for recipes --- src/Plots.jl | 3 +++ src/recipes.jl | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/Plots.jl b/src/Plots.jl index 90bd5ea3..8643ee0a 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -144,6 +144,9 @@ export arcdiagram, chorddiagram, + @default_kw, + @force_kw, + translate, translate!, rotate, diff --git a/src/recipes.jl b/src/recipes.jl index 4bfcadb2..f347c3a5 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -28,6 +28,13 @@ function _apply_recipe(d::KW, args...; issubplot=false, kw...) args end +macro default_kw(k, v) + esc(:(get!(d, $k, $v))) +end + +macro force_kw(k, v) + esc(:(d[$k] = $v)) +end # ---------------------------------------------------------------------------