From c4d3502608a9a2e96af35b719d693a860dea61dd Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Wed, 10 Nov 2021 21:18:08 +0100 Subject: [PATCH] respect defaults --- src/args.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/args.jl b/src/args.jl index 16dbe1d6..c7f083fe 100644 --- a/src/args.jl +++ b/src/args.jl @@ -1949,9 +1949,12 @@ end function _update_subplot_legend(sp::Subplot, plotattributes_in) f_attr = NamedTuple( k => plotattributes_in[Symbol(:legend_font_, k)] for k in (:family, :pointsize, :valign, :halign, :rotation, :color) if haskey(plotattributes_in, Symbol(:legend_font_, k))) - match_attr = NamedTuple( k => sp[Symbol(:legend_font_, k)] for k in (:family, :pointsize, :valign, :halign, :rotation, :color) if haskey(_match_map, Symbol(:legend_font_, k))) - sp.attr[:legend_font] = font(default(plotattributes_in, :legend_font); - merge(f_attr, match_attr)... + match_attr = NamedTuple( (lk = Symbol(:legend_font_, k); k => haskey(_match_map, lk) ? sp[lk] : + haskey(plotattributes_in, :legend_font) ? getproperty(plotattributes_in[:legend_font], k) : + default(plotattributes_in, lk)) + for k in (:family, :pointsize, :valign, :halign, :rotation, :color)) + sp.attr[:legend_font] = font(; + merge(match_attr, f_attr)... ) end