Fix showaxis (#2733)

* also replace axis syms

* include test_axes [skip ci]

* Create test_axes.jl

* process showaxis
This commit is contained in:
Simon Christ 2020-05-26 20:40:44 +02:00 committed by GitHub
parent 02e6d729c1
commit 42e2266530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

View File

@ -946,7 +946,8 @@ function RecipesPipeline.preprocess_attributes!(plotattributes::AKW)
# handle axis args common to all axis # handle axis args common to all axis
args = RecipesPipeline.pop_kw!(plotattributes, :axis, ()) args = RecipesPipeline.pop_kw!(plotattributes, :axis, ())
for arg in wraptuple(args) showarg = wraptuple(RecipesPipeline.pop_kw!(plotattributes, :showaxis, ()))
for arg in wraptuple((args..., showarg...))
for letter in (:x, :y, :z) for letter in (:x, :y, :z)
process_axis_arg!(plotattributes, arg, letter) process_axis_arg!(plotattributes, arg, letter)
end end

View File

@ -35,7 +35,6 @@ end
function process_axis_arg!(plotattributes::AKW, arg, letter = "") function process_axis_arg!(plotattributes::AKW, arg, letter = "")
T = typeof(arg) T = typeof(arg)
arg = get(_scaleAliases, arg, arg) arg = get(_scaleAliases, arg, arg)
if typeof(arg) <: Font if typeof(arg) <: Font
plotattributes[Symbol(letter,:tickfont)] = arg plotattributes[Symbol(letter,:tickfont)] = arg
plotattributes[Symbol(letter,:guidefont)] = arg plotattributes[Symbol(letter,:guidefont)] = arg

View File

@ -9,6 +9,7 @@ using LibGit2
using GeometryTypes using GeometryTypes
using Dates using Dates
include("test_axes.jl")
include("test_hdf5plots.jl") include("test_hdf5plots.jl")
include("test_pgfplotsx.jl") include("test_pgfplotsx.jl")

6
test/test_axes.jl Normal file
View File

@ -0,0 +1,6 @@
using Plots, Test
@testset "Showaxis" begin
@test plot(1:5, showaxis = :y)[1][:yaxis][:showaxis] == true
@test plot(1:5, showaxis = :y)[1][:xaxis][:showaxis] == false
end