diff --git a/.travis.yml b/.travis.yml index d05dcb78..df29259b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,8 @@ notifications: # uncomment the following lines to override the default test script script: - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - - julia -e 'Pkg.clone("Images"); Pkg.checkout("Images","50872b3045600d6811b1ffba343bf75467d681c5"); Pkg.clone("ImageMagick"); Pkg.build("ImageMagick")' + - julia -e 'Pkg.clone("https://github.com/tbreloff/Images.jl.git"); Pkg.checkout("Images","tom_imgcompare");' + - jukai -e 'Pkg.clone("ImageMagick"); Pkg.build("ImageMagick")' - julia -e 'Pkg.clone("Cairo"); Pkg.build("Cairo")' - julia -e 'Pkg.clone(pwd()); Pkg.build("Plots")' - julia -e 'Pkg.test("Plots"; coverage=true)' diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index 3296bccd..01308117 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -6,6 +6,7 @@ # convert colorant to 4-tuple RGBA getPyPlotColor(c::Colorant) = map(f->float(f(c)), (red, green, blue, alpha)) getPyPlotColor(scheme::ColorScheme) = getPyPlotColor(getColor(scheme)) +getPyPlotColor(c) = getPyPlotColor(convertColor(c)) # getPyPlotColorMap(c::ColorGradient) = PyPlot.matplotlib[:colors][:ListedColormap](map(getPyPlotColor, getColorVector(c))) function getPyPlotColorMap(c::ColorGradient) diff --git a/test/REQUIRE b/test/REQUIRE index 73ca272e..a5de3587 100644 --- a/test/REQUIRE +++ b/test/REQUIRE @@ -6,3 +6,4 @@ FactCheck Gadfly Images ImageMagick +PyPlot diff --git a/test/runtests.jl b/test/runtests.jl index d787b995..7278a4d4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,11 +3,11 @@ module PlotsTests # don't let pyplot use a gui... it'll crash # note: Agg will set gui -> :none in PyPlot +ENV["MPLBACKEND"] = "Agg" try - ENV["MPLBACKEND"] = "Agg" - import PyPlot + @eval import PyPlot catch err - warn("Couldn't import PyPlot: ", err) + warn("Couldn't import PyPlot: $err") end @@ -30,6 +30,8 @@ default(show=false) # gadfly() # backend() +img_eps = 1e-2 + facts("Gadfly") do @fact gadfly() --> Plots.GadflyPackage() @fact backend() --> Plots.GadflyPackage() @@ -47,14 +49,14 @@ facts("Gadfly") do # plot(x::AMat, y::AMat; kw...) # multiple lines (one per column of x/y... will assert size(x) == size(y)) @fact plot!(rand(10,3), rand(10,3)) --> not(nothing) - image_comparison_tests(:gadfly, skip=[4,19], eps=1e-2) + image_comparison_tests(:gadfly, skip=[4,19], eps=img_eps) end facts("PyPlot") do @fact pyplot() --> Plots.PyPlotPackage() @fact backend() --> Plots.PyPlotPackage() - image_comparison_tests(:pyplot) + image_comparison_tests(:pyplot, skip=[19], eps=img_eps) end