Merge pull request #3398 from hustf/fix#3397

Bugfix and test, issue #3397
This commit is contained in:
Daniel Schwabeneder 2021-03-31 14:12:22 +02:00 committed by GitHub
commit d2c85bdff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -756,7 +756,7 @@ function axis_drawing_info_3d(sp, letter)
# don't show the 0 tick label for the origin framestyle
if sp[:framestyle] == :origin && !(ticks in (:none, nothing, false)) && length(ticks) > 1
i0 = findfirst(==(0), ticks[1])
if ind !== nothing
if i0 !== nothing
deleteat!(ticks[1], i0)
deleteat!(ticks[2], i0)
end

View File

@ -31,3 +31,19 @@ end # testset
sticks = plot(tri, seriestype = :sticks)
@test length(sticks) == 1
end
@testset "framestyle axes" begin
pl = plot(-1:1, -1:1, -1:1)
sp = pl.subplots[1]
defaultret = Plots.axis_drawing_info_3d(sp, :x)
for letter in [:x, :y, :z]
for fr in [:box :semi :origin :zerolines :grid :none]
prevha = UInt64(0)
push!(sp.attr, :framestyle => fr)
ret = Plots.axis_drawing_info_3d(sp, letter)
ha = hash(string(ret))
@test ha != prevha
prevha = ha
end
end
end