fix showaxis fix (#2737)

* also replace axis syms

* process showaxis

* fix axis keyword
This commit is contained in:
Simon Christ 2020-05-27 15:23:02 +02:00 committed by GitHub
parent a270e342b7
commit 8c6295658b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

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

View File

@ -1,6 +1,14 @@
using Plots, Test using Plots, Test
@testset "Showaxis" begin @testset "Showaxis" begin
for value in Plots._allShowaxisArgs
@test plot(1:5, showaxis = value)[1][:yaxis][:showaxis] isa Bool
end
@test plot(1:5, showaxis = :y)[1][:yaxis][:showaxis] == true @test plot(1:5, showaxis = :y)[1][:yaxis][:showaxis] == true
@test plot(1:5, showaxis = :y)[1][:xaxis][:showaxis] == false @test plot(1:5, showaxis = :y)[1][:xaxis][:showaxis] == false
end end
@testset "Magic axis" begin
@test plot(1, axis=nothing)[1][:xaxis][:ticks] == []
@test plot(1, axis=nothing)[1][:yaxis][:ticks] == []
end # testset