more fixes

This commit is contained in:
Simon Christ 2021-10-19 11:08:56 +02:00
parent 4ed195f8d9
commit 3aa6cca70f
3 changed files with 8 additions and 4 deletions

View File

@ -1271,7 +1271,7 @@ function gr_get_legend_geometry(viewport_plotarea, sp)
x_legend_offset = (viewport_plotarea[2] - viewport_plotarea[1]) / 30
y_legend_offset = (viewport_plotarea[4] - viewport_plotarea[3]) / 30
dy = get(sp[:extra_kwargs], :legend_hfactor, 1)
dy *= get(sp[:extra_kwargs], :legend_hfactor, 1)
legendh = dy * legendn
return (

View File

@ -72,13 +72,11 @@ const _all_args = sort(union([
for arg in _all_args
add_aliases(arg, makeplural(arg))
end
# add all non_underscored forms to the _keyAliases
add_non_underscore_aliases!(_keyAliases)
# fill symbol cache
for letter in (:x, :y, :z)
_attrsymbolcache[letter] = Dict{Symbol, Symbol}()
for k in keys(_axis_defaults)
for k in _axis_args
# populate attribute cache
lk = Symbol(letter, k)
_attrsymbolcache[letter][k] = lk
@ -89,3 +87,6 @@ for letter in (:x, :y, :z)
_attrsymbolcache[letter][k] = Symbol(letter, k)
end
end
# add all non_underscored forms to the _keyAliases
add_non_underscore_aliases!(_keyAliases)

View File

@ -65,6 +65,9 @@ end
end
@testset "axis-aliases" begin
@test haskey(Plots._keyAliases, :xguideposition)
@test haskey(Plots._keyAliases, :x_guide_position)
@test !haskey(Plots._keyAliases, :xguide_position)
p = plot(1:2, xl = "x label")
@test p[1][:xaxis][:guide] === "x label"
p = plot(1:2, xrange = (0, 3))