From cab76f67e2bd601883f66c49910b75cde7153dba Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Thu, 9 Dec 2021 10:32:06 +0100 Subject: [PATCH] fix scale warnings for layouts (#3992) * fix scale warnings for layouts * don't run ci twice on PR * use broadcasting for scalar case --- .github/workflows/ci.yml | 2 ++ src/args.jl | 2 +- test/runtests.jl | 1 + test/test_layouts.jl | 9 +++++++++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/test_layouts.jl diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2d41fba..7edb8f79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,8 @@ name: ci on: push: + branches: + - master pull_request: defaults: diff --git a/src/args.jl b/src/args.jl index f76a6f59..b92198f7 100644 --- a/src/args.jl +++ b/src/args.jl @@ -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(is_scale_supported.(Ref(pkg), v)) @warn( "scale $v is unsupported with $pkg. Choose from: $(supported_scales(pkg))" ) diff --git a/test/runtests.jl b/test/runtests.jl index 4d9ac73f..4d1bfa2a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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") diff --git a/test/test_layouts.jl b/test/test_layouts.jl new file mode 100644 index 00000000..e28f984d --- /dev/null +++ b/test/test_layouts.jl @@ -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