diff --git a/src/args.jl b/src/args.jl index 389cbb68..727cc019 100644 --- a/src/args.jl +++ b/src/args.jl @@ -1484,7 +1484,7 @@ function RecipesPipeline.preprocess_attributes!(plotattributes::AKW) # fonts for fontname in - (:titlefont, :legendfont, :legendtitlefont, :plot_titlefont, :colorbar_titlefont) + (:titlefont, :legendtitlefont, :plot_titlefont, :colorbar_titlefont) args = RecipesPipeline.pop_kw!(plotattributes, fontname, ()) for arg in wraptuple(args) processFontArg!(plotattributes, fontname, arg) @@ -1947,6 +1947,11 @@ function _update_subplot_colors(sp::Subplot) return end +function _update_subplot_legend(sp::Subplot, plotattributes_in) + @show plotattributes_in |> keys + # sp.attr[:legend] = Legend(background_color = sp[:legend_background_color], foreground_color = sp[:legend_foreground_color], position = sp[:legend_position], title = sp[:legend_title], font = font(sp[:legend_font]; )) # TODO: make legend_font and legend_font_* attributes coherent +end + function _update_axis( plt::Plot, sp::Subplot, @@ -2039,6 +2044,7 @@ function _update_subplot_args( _update_subplot_periphery(sp, anns) _update_subplot_colors(sp) + _update_subplot_legend(sp, plotattributes_in) lims_warned = false for letter in (:x, :y, :z) diff --git a/test/test_defaults.jl b/test/test_defaults.jl index 4f9e1ae7..777cd2e7 100644 --- a/test/test_defaults.jl +++ b/test/test_defaults.jl @@ -67,4 +67,7 @@ end # testset @test p[1][:legend_title_font_color] == :blue @test p[1][:legend_background_color] == RGBA{Float64}(0.0, 1.0, 1.0, 1.0) @test p[1][:legend_foreground_color] == RGBA{Float64}(0.0, 0.5019607843137255, 0.0, 1.0) + + #setting whole font + @test plot(1:5, legendfont=font(12))[1][:legend_font_pointsize] == 12 end # testset