From 40e13793e812a9037b0cc5e7b3a66291b1326dce Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Thu, 12 Nov 2020 14:34:18 +0100 Subject: [PATCH] add new test example --- Project.toml | 3 ++- src/examples.jl | 19 +++++++++++++++++-- test/runtests.jl | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index e4fa8433..623d7c43 100644 --- a/Project.toml +++ b/Project.toml @@ -68,8 +68,9 @@ StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990" UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228" VisualRegressionTests = "34922c18-7c2a-561c-bac1-01e79b2c4c92" [targets] -test = ["Distributions", "FileIO", "Gtk", "ImageMagick", "Images", "LibGit2", "OffsetArrays", "PGFPlotsX", "HDF5", "RDatasets", "StableRNGs", "StaticArrays", "StatsPlots", "Test", "UnicodePlots", "VisualRegressionTests"] +test = ["Distributions", "FileIO", "Gtk", "ImageMagick", "Images", "LibGit2", "OffsetArrays", "PGFPlotsX", "HDF5", "RDatasets", "StableRNGs", "StaticArrays", "StatsPlots", "Test", "TestImages", "UnicodePlots", "VisualRegressionTests"] diff --git a/src/examples.jl b/src/examples.jl index c5efc2fc..d5bf01f3 100644 --- a/src/examples.jl +++ b/src/examples.jl @@ -1067,6 +1067,20 @@ const _examples = PlotExample[ ) end] ), + PlotExample( # 51 + "Images with custom axes", + "", + [quote + using Plots + using TestImages + img = testimage("lighthouse") + + # plot the image reversing the first dimension and setting yflip = false + plot([-π, π], [-1, 1], reverse(img, dims=1), yflip=false, aspect_ratio=:none) + # plot other data + plot!(sin, -π, π, lw=3, color=:red) + end] + ), ] # Some constants for PlotDocs and PlotReferenceImages @@ -1074,8 +1088,8 @@ _animation_examples = [2, 31] _backend_skips = Dict( :gr => [25, 30, 47], :pyplot => [2, 25, 30, 31, 47, 49], - :plotlyjs => [2, 21, 24, 25, 30, 31, 49], - :plotly => [2, 21, 24, 25, 30, 31, 49], + :plotlyjs => [2, 21, 24, 25, 30, 31, 49, 51], + :plotly => [2, 21, 24, 25, 30, 31, 49, 51], :pgfplotsx => [ 2, # animation 6, # images @@ -1084,6 +1098,7 @@ _backend_skips = Dict( 31, # animation 32, # spy 49, # polar heatmap + 51, # image with custom axes ], ) diff --git a/test/runtests.jl b/test/runtests.jl index 5cd843ec..18ac4366 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,6 +4,7 @@ using Plots using Random using StableRNGs using Test +using TestImages using FileIO using Gtk using LibGit2