fix gr legend position
This commit is contained in:
parent
99d1d483c5
commit
c496b9c615
@ -1300,9 +1300,9 @@ function gr_update_viewport_legend!(viewport_plotarea, sp, leg)
|
||||
yaxis[:guide_position] == :right ||
|
||||
(yaxis[:guide_position] == :auto && yaxis[:mirror] == true)
|
||||
|
||||
if s isa Tuple{<:Real,Symbol}
|
||||
if s[2] === :outer
|
||||
(x, y) = gr_legend_pos(sp, leg, viewport_plotarea) # Dry run, to figure out
|
||||
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 +
|
||||
@ -1321,7 +1321,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
|
||||
|
||||
@ -62,8 +62,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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user