From 663e1673654ad42a34f8a2acd528143b3861d326 Mon Sep 17 00:00:00 2001 From: Pearl Li Date: Tue, 11 Jan 2022 13:16:09 -0800 Subject: [PATCH] Add plot title tests --- test/test_layouts.jl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test_layouts.jl b/test/test_layouts.jl index 74daeea9..41ce0bdf 100644 --- a/test/test_layouts.jl +++ b/test/test_layouts.jl @@ -11,3 +11,17 @@ using Plots, Test @test pl[3][:yaxis][:scale] == :log10 @test pl[4][:yaxis][:scale] == :log10 end + +@testset "Plot title" begin + pl = plot(rand(4, 8), layout = 4, plot_title = "My title") + @test pl[:plot_title] == "My title" + @test pl[:plot_titleindex] == 5 + + plot!(pl) + @test pl[:plot_title] == "My title" + @test pl[:plot_titleindex] == 5 + + plot!(pl, plot_title = "My new title") + @test pl[:plot_title] == "My new title" + @test pl[:plot_titleindex] == 5 +end