From 727ced25f1c39b8169086d2e83300ec2e8682a4c Mon Sep 17 00:00:00 2001 From: hustf Date: Mon, 29 Mar 2021 12:29:47 +0200 Subject: [PATCH] modified: src/axes.jl #3397 fix varname modified: test/test_recipes.jl #3397 test all framestyles effect --- src/axes.jl | 2 +- test/test_recipes.jl | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/axes.jl b/src/axes.jl index e2f031ad..2f6c4beb 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -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 diff --git a/test/test_recipes.jl b/test/test_recipes.jl index d2dcfdf4..a228d2a6 100644 --- a/test/test_recipes.jl +++ b/test/test_recipes.jl @@ -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 \ No newline at end of file