From 3aa6cca70fc5b2409466f89a598e71497f83202b Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Tue, 19 Oct 2021 11:08:56 +0200 Subject: [PATCH] more fixes --- src/backends/gr.jl | 2 +- src/consts.jl | 7 ++++--- test/test_axes.jl | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index c8923145..b773a0fe 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -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 ( diff --git a/src/consts.jl b/src/consts.jl index 80af56b2..b9c8cde5 100644 --- a/src/consts.jl +++ b/src/consts.jl @@ -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) diff --git a/test/test_axes.jl b/test/test_axes.jl index cd184708..0d8a1526 100644 --- a/test/test_axes.jl +++ b/test/test_axes.jl @@ -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))