Plots.jl/test/test_args.jl
Simon Christ 9e34ed0383
add permute, deprecate orientation (#4164)
* add series_permutation

* works for dates and categorical input, not vector of strings

* Update src/pipeline.jl

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update src/pipeline.jl

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* add test

* correct test

* make bar workign

* add deprecation

* rename series_permutation -> permute

* add Documentation

* fix uneccessary deprecation

* permute h/vlines

* Auto-format

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* 1.29.0

* Update Project.toml [skip ci]

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-05-05 15:15:56 +02:00

28 lines
1.0 KiB
Julia

using Plots, Test
@testset "Series Attributes" begin
pl = plot([[1, 2, 3], [2, 3, 4]], lw = 5)
@test hline!(deepcopy(pl), [1.75])[1].series_list[3][:label] ==
hline!(deepcopy(pl), [1.75], z_order = :front)[1].series_list[3][:label] ==
"y3"
@test hline!(deepcopy(pl), [1.75], z_order = :back)[1].series_list[1][:label] == "y3"
@test hline!(deepcopy(pl), [1.75], z_order = 2)[1].series_list[2][:label] == "y3"
end
@testset "Axis Attributes" begin
pl = @test_nowarn plot(; tickfont = font(10, "Times"))
for axis in (:xaxis, :yaxis, :zaxis)
@test pl[1][axis][:tickfontsize] == 10
@test pl[1][axis][:tickfontfamily] == "Times"
end
end
@testset "Permute recipes" begin
pl = bar(["a", "b", "c"], [1, 2, 3])
ppl = bar(["a", "b", "c"], [1, 2, 3], permute = (:x, :y))
@test xticks(ppl) == yticks(pl)
@test yticks(ppl) == xticks(pl)
@test filter(isfinite, pl[1][1][:x]) == filter(isfinite, ppl[1][1][:y])
@test filter(isfinite, pl[1][1][:y]) == filter(isfinite, ppl[1][1][:x])
end