fix scale warnings for layouts (#3992)
* fix scale warnings for layouts * don't run ci twice on PR * use broadcasting for scalar case
This commit is contained in:
parent
95c0ea7a68
commit
9d1bda9c8d
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -2,6 +2,8 @@ name: ci
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
|
|||||||
@ -1644,7 +1644,7 @@ function warn_on_unsupported_scales(pkg::AbstractBackend, plotattributes::AKW)
|
|||||||
for k in (:xscale, :yscale, :zscale, :scale)
|
for k in (:xscale, :yscale, :zscale, :scale)
|
||||||
if haskey(plotattributes, k)
|
if haskey(plotattributes, k)
|
||||||
v = plotattributes[k]
|
v = plotattributes[k]
|
||||||
if !is_scale_supported(pkg, v)
|
if !all(is_scale_supported.(Ref(pkg), v))
|
||||||
@warn(
|
@warn(
|
||||||
"scale $v is unsupported with $pkg. Choose from: $(supported_scales(pkg))"
|
"scale $v is unsupported with $pkg. Choose from: $(supported_scales(pkg))"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -40,6 +40,7 @@ end
|
|||||||
include("test_defaults.jl")
|
include("test_defaults.jl")
|
||||||
include("test_pipeline.jl")
|
include("test_pipeline.jl")
|
||||||
include("test_axes.jl")
|
include("test_axes.jl")
|
||||||
|
include("test_layouts.jl")
|
||||||
include("test_contours.jl")
|
include("test_contours.jl")
|
||||||
include("test_axis_letter.jl")
|
include("test_axis_letter.jl")
|
||||||
include("test_components.jl")
|
include("test_components.jl")
|
||||||
|
|||||||
9
test/test_layouts.jl
Normal file
9
test/test_layouts.jl
Normal 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
|
||||||
Loading…
x
Reference in New Issue
Block a user