fix scale warnings for layouts

This commit is contained in:
Simon Christ 2021-12-09 09:38:23 +01:00
parent 461476f4ed
commit 691a7591ac
3 changed files with 11 additions and 1 deletions

View File

@ -1644,7 +1644,7 @@ function warn_on_unsupported_scales(pkg::AbstractBackend, plotattributes::AKW)
for k in (:xscale, :yscale, :zscale, :scale)
if haskey(plotattributes, k)
v = plotattributes[k]
if !is_scale_supported(pkg, v)
if !all(x->is_scale_supported(pkg, x), v)
@warn(
"scale $v is unsupported with $pkg. Choose from: $(supported_scales(pkg))"
)

View File

@ -40,6 +40,7 @@ end
include("test_defaults.jl")
include("test_pipeline.jl")
include("test_axes.jl")
include("test_layouts.jl")
include("test_contours.jl")
include("test_axis_letter.jl")
include("test_components.jl")

9
test/test_layouts.jl Normal file
View File

@ -0,0 +1,9 @@
using Plots, Test
@testset "Subplot sclicing" begin
pl = @test_nowarn plot(rand(4,8), layout=4, yscale=[:identity :identity :log10 :log10])
@test pl[1][:yaxis][:scale] == :identity
@test pl[2][:yaxis][:scale] == :identity
@test pl[3][:yaxis][:scale] == :log10
@test pl[4][:yaxis][:scale] == :log10
end