diff --git a/src/backends/gr.jl b/src/backends/gr.jl index fc3e78e4..c0cad18b 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -1218,8 +1218,8 @@ function gr_update_viewport_legend!(viewport_plotarea, sp, leg) xmirror = xaxis[:guide_position] == :top || (xaxis[:guide_position] == :auto && xaxis[:mirror] == true) ymirror = yaxis[:guide_position] == :right || (yaxis[:guide_position] == :auto && yaxis[:mirror] == true) - if s isa Tuple{<:Real,Symbol} - if s[2] === :outer + if sp[:legend_position] isa Tuple{<:Real,Symbol} + if sp[:legend_position][2] === :outer (x,y) = gr_legend_pos(sp, leg, viewport_plotarea) # Dry run, to figure out if x < viewport_plotarea[1] viewport_plotarea[1] += leg.leftw + leg.textw + leg.rightw + leg.xoffset + !ymirror * gr_axis_width(sp, sp[:yaxis]) @@ -1233,7 +1233,6 @@ function gr_update_viewport_legend!(viewport_plotarea, sp, leg) end end end - leg_str = string(s) if occursin("outer", leg_str) if occursin("right", leg_str) viewport_plotarea[2] -= leg.leftw + leg.textw + leg.rightw + leg.xoffset diff --git a/test/test_defaults.jl b/test/test_defaults.jl index 5523dd91..628dd430 100644 --- a/test/test_defaults.jl +++ b/test/test_defaults.jl @@ -60,8 +60,7 @@ end # testset # FIXME: this doesn't get set @test_broken p[1][:legend_title] == "The legend" @test p[1][:legend_title_font_family] == "helvetica" - # FIXME: this doesn't get set - @test_broken p[1][:legend_title_font_pointsize] == 3 + @test p[1][:legend_title_font_pointsize] == 3 @test p[1][:legend_title_font_halign] == :right @test p[1][:legend_title_font_valign] == :bottom @test p[1][:legend_title_font_rotation] == -5.2