diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index 67b8ec11..e0e3de46 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -680,10 +680,10 @@ for (mime, fmt) in _pyplot_mimeformats fig = getfig(plt.o) fig.o["canvas"][:print_figure](io, format=$fmt, - bbox_inches="tight", + # bbox_inches="tight", facecolor = fig.o["get_facecolor"](), - edgecolor = "none" - # edgecolor = fig.o["get_edgecolor"]() + edgecolor = "none", + dpi = 96 ) end end diff --git a/test/imgcomp.jl b/test/imgcomp.jl index 98e3390f..c3b256fe 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -2,6 +2,8 @@ # include this first to help with crashing?? try @eval using Gtk +catch err + warn("Gtk not loaded. err: $err") end # don't let pyplot use a gui... it'll crash @@ -11,23 +13,9 @@ try @eval import PyPlot end -# macro test_approx_eq_sigma_eps(A, B, sigma, eps) - include("../docs/example_generation.jl") -# # make and display one plot -# function test_examples(pkg::Symbol, idx::Int; debug = true) -# Plots._debugMode.on = debug -# println("Testing plot: $pkg:$idx:$(examples[idx].header)") -# backend(pkg) -# backend() -# map(eval, examples[idx].exprs) -# plt = current() -# gui(plt) -# plt -# end - using Plots, FactCheck import Images, ImageMagick @@ -54,75 +42,23 @@ end "Show a Gtk popup with both images and a confirmation whether we should replace the new image with the old one" function compareToReferenceImage(tmpfn, reffn) - # println("here000") - # @eval import Gtk - # Gtk.gtk_main() - # println("huh0") - # sleep(2) # add the images imgbox = Gtk.GtkBoxLeaf(:h) - # println("huh") push!(imgbox, makeImageWidget(tmpfn)) - # println("huh2") push!(imgbox, makeImageWidget(reffn)) - # println("here00") - - # add the buttons - # doNothingButton = Gtk.GtkButtonLeaf("Skip") - # replaceReferenceButton = Gtk.GtkButtonLeaf("Replace reference image") - # btnbox = Gtk.GtkButtonBoxLeaf(:h) - # push!(btnbox, doNothingButton) - # push!(btnbox, replaceReferenceButton) - - # # create the window - # box = Gtk.GtkBoxLeaf(:v) - # push!(box, imgbox) - # push!(box, btnbox) win = Gtk.GtkWindowLeaf("Should we make this the new reference image?") push!(win, Gtk.GtkFrameLeaf(imgbox)) - # println("here01") - - # ################ - # # TODO: remove this when it's fixed in Gtk... see http://stackoverflow.com/questions/33549485/julia-gtk-windows-do-not-display-outside-repl - # signal_connect(win, :destroy) do widget - # Gtk.gtk_quit() - # end - # ################ - - # println("here02") showall(win) - # println("here1") - # now ask the question if Gtk.ask_dialog("Should we make this the new reference image?", "No", "Yes") replaceReferenceImage(tmpfn, reffn) end - # println("here2") destroy(win) - # println("here3") - - # # we'll wait on this condition - # c = Condition() - # Gtk.on_signal_destroy((x...) -> notify(c), win) - - # Gtk.signal_connect(replaceReferenceButton, "clicked") do widget - # replaceReferenceImage(tmpfn, reffn) - # notify(c) - # end - - # Gtk.signal_connect(doNothingButton, "clicked") do widget - # notify(c) - # end - - # # wait until a button is clicked, then close the window - # Gtk.showall(win) - # wait(c) - # Gtk.destroy(win) end @@ -151,7 +87,6 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, sigma = [1 tmpimg = Images.load(tmpfn) # reference image location - # refdir = joinpath(Pkg.dir("Plots"), "test", "refimg", "v$(VERSION.major).$(VERSION.minor)", string(pkg)) refdir = joinpath(Pkg.dir("Plots"), "test", "refimg", string(pkg)) try run(`mkdir -p $refdir`) @@ -185,7 +120,7 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, sigma = [1 # if we're in interactive mode, open a popup and give us a chance to examine the images warn("Should we make this the new reference image?") compareToReferenceImage(tmpfn, reffn) - println("exited") + # println("exited") return else diff --git a/test/refimg/gadfly/ref11.png b/test/refimg/gadfly/ref11.png index 7e87bd24..57eafde4 100644 Binary files a/test/refimg/gadfly/ref11.png and b/test/refimg/gadfly/ref11.png differ diff --git a/test/refimg/gadfly/ref16.png b/test/refimg/gadfly/ref16.png index 90cd7ad1..09551adc 100644 Binary files a/test/refimg/gadfly/ref16.png and b/test/refimg/gadfly/ref16.png differ diff --git a/test/refimg/pyplot/ref1.png b/test/refimg/pyplot/ref1.png index 3e9371db..200e5e2e 100644 Binary files a/test/refimg/pyplot/ref1.png and b/test/refimg/pyplot/ref1.png differ diff --git a/test/refimg/pyplot/ref10.png b/test/refimg/pyplot/ref10.png index a6825f72..cb603fd7 100644 Binary files a/test/refimg/pyplot/ref10.png and b/test/refimg/pyplot/ref10.png differ diff --git a/test/refimg/pyplot/ref11.png b/test/refimg/pyplot/ref11.png index 76585bf9..f9b54051 100644 Binary files a/test/refimg/pyplot/ref11.png and b/test/refimg/pyplot/ref11.png differ diff --git a/test/refimg/pyplot/ref12.png b/test/refimg/pyplot/ref12.png index 2f34ed9e..107ff487 100644 Binary files a/test/refimg/pyplot/ref12.png and b/test/refimg/pyplot/ref12.png differ diff --git a/test/refimg/pyplot/ref13.png b/test/refimg/pyplot/ref13.png index 8bd13c69..21517017 100644 Binary files a/test/refimg/pyplot/ref13.png and b/test/refimg/pyplot/ref13.png differ diff --git a/test/refimg/pyplot/ref14.png b/test/refimg/pyplot/ref14.png index 5a48963a..dc34215d 100644 Binary files a/test/refimg/pyplot/ref14.png and b/test/refimg/pyplot/ref14.png differ diff --git a/test/refimg/pyplot/ref15.png b/test/refimg/pyplot/ref15.png index 48496bb8..1da336e5 100644 Binary files a/test/refimg/pyplot/ref15.png and b/test/refimg/pyplot/ref15.png differ diff --git a/test/refimg/pyplot/ref16.png b/test/refimg/pyplot/ref16.png index f4f15ceb..41883a66 100644 Binary files a/test/refimg/pyplot/ref16.png and b/test/refimg/pyplot/ref16.png differ diff --git a/test/refimg/pyplot/ref17.png b/test/refimg/pyplot/ref17.png index f5399147..07623d30 100644 Binary files a/test/refimg/pyplot/ref17.png and b/test/refimg/pyplot/ref17.png differ diff --git a/test/refimg/pyplot/ref18.png b/test/refimg/pyplot/ref18.png index 4d770956..b25603b7 100644 Binary files a/test/refimg/pyplot/ref18.png and b/test/refimg/pyplot/ref18.png differ diff --git a/test/refimg/pyplot/ref2.png b/test/refimg/pyplot/ref2.png index e5eeaa8b..7bdb0f88 100644 Binary files a/test/refimg/pyplot/ref2.png and b/test/refimg/pyplot/ref2.png differ diff --git a/test/refimg/pyplot/ref20.png b/test/refimg/pyplot/ref20.png index 6ba1d86e..b3931b0b 100644 Binary files a/test/refimg/pyplot/ref20.png and b/test/refimg/pyplot/ref20.png differ diff --git a/test/refimg/pyplot/ref21.png b/test/refimg/pyplot/ref21.png index d7bcd812..c75c93d7 100644 Binary files a/test/refimg/pyplot/ref21.png and b/test/refimg/pyplot/ref21.png differ diff --git a/test/refimg/pyplot/ref3.png b/test/refimg/pyplot/ref3.png index 29abb07a..76bfa86f 100644 Binary files a/test/refimg/pyplot/ref3.png and b/test/refimg/pyplot/ref3.png differ diff --git a/test/refimg/pyplot/ref4.png b/test/refimg/pyplot/ref4.png index 205ca829..ea4be4ba 100644 Binary files a/test/refimg/pyplot/ref4.png and b/test/refimg/pyplot/ref4.png differ diff --git a/test/refimg/pyplot/ref5.png b/test/refimg/pyplot/ref5.png index b74d1cff..1617096c 100644 Binary files a/test/refimg/pyplot/ref5.png and b/test/refimg/pyplot/ref5.png differ diff --git a/test/refimg/pyplot/ref6.png b/test/refimg/pyplot/ref6.png index 0ca44118..1087b3ef 100644 Binary files a/test/refimg/pyplot/ref6.png and b/test/refimg/pyplot/ref6.png differ diff --git a/test/refimg/pyplot/ref7.png b/test/refimg/pyplot/ref7.png index 04653f98..878f6adc 100644 Binary files a/test/refimg/pyplot/ref7.png and b/test/refimg/pyplot/ref7.png differ diff --git a/test/refimg/pyplot/ref8.png b/test/refimg/pyplot/ref8.png index 890d5abb..bb3c6d5e 100644 Binary files a/test/refimg/pyplot/ref8.png and b/test/refimg/pyplot/ref8.png differ diff --git a/test/refimg/pyplot/ref9.png b/test/refimg/pyplot/ref9.png index 915824eb..7a6c985f 100644 Binary files a/test/refimg/pyplot/ref9.png and b/test/refimg/pyplot/ref9.png differ