add new test example

This commit is contained in:
Daniel Schwabeneder 2020-11-12 14:34:18 +01:00
parent 5d26068eae
commit 40e13793e8
3 changed files with 20 additions and 3 deletions

View File

@ -68,8 +68,9 @@ StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990"
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228" UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
VisualRegressionTests = "34922c18-7c2a-561c-bac1-01e79b2c4c92" VisualRegressionTests = "34922c18-7c2a-561c-bac1-01e79b2c4c92"
[targets] [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"]

View File

@ -1067,6 +1067,20 @@ const _examples = PlotExample[
) )
end] 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 # Some constants for PlotDocs and PlotReferenceImages
@ -1074,8 +1088,8 @@ _animation_examples = [2, 31]
_backend_skips = Dict( _backend_skips = Dict(
:gr => [25, 30, 47], :gr => [25, 30, 47],
:pyplot => [2, 25, 30, 31, 47, 49], :pyplot => [2, 25, 30, 31, 47, 49],
:plotlyjs => [2, 21, 24, 25, 30, 31, 49], :plotlyjs => [2, 21, 24, 25, 30, 31, 49, 51],
:plotly => [2, 21, 24, 25, 30, 31, 49], :plotly => [2, 21, 24, 25, 30, 31, 49, 51],
:pgfplotsx => [ :pgfplotsx => [
2, # animation 2, # animation
6, # images 6, # images
@ -1084,6 +1098,7 @@ _backend_skips = Dict(
31, # animation 31, # animation
32, # spy 32, # spy
49, # polar heatmap 49, # polar heatmap
51, # image with custom axes
], ],
) )

View File

@ -4,6 +4,7 @@ using Plots
using Random using Random
using StableRNGs using StableRNGs
using Test using Test
using TestImages
using FileIO using FileIO
using Gtk using Gtk
using LibGit2 using LibGit2