some fixes for subplots and imgcmp

This commit is contained in:
Thomas Breloff 2015-10-24 16:11:55 -04:00
parent 7e740861d8
commit e76ded69e6
21 changed files with 25 additions and 12 deletions

View File

@ -149,7 +149,7 @@ _plotDefaults[:yticks] = :auto
_plotDefaults[:xscale] = :identity _plotDefaults[:xscale] = :identity
_plotDefaults[:yscale] = :identity _plotDefaults[:yscale] = :identity
_plotDefaults[:xflip] = false _plotDefaults[:xflip] = false
_plotDefaults[:yflip] = true _plotDefaults[:yflip] = false
_plotDefaults[:size] = (600,400) _plotDefaults[:size] = (600,400)
_plotDefaults[:pos] = (0,0) _plotDefaults[:pos] = (0,0)
_plotDefaults[:windowtitle] = "Plots.jl" _plotDefaults[:windowtitle] = "Plots.jl"

View File

@ -398,9 +398,9 @@ end
function updateGadflyPlotTheme(plt::Plot, d::Dict) function updateGadflyPlotTheme(plt::Plot, d::Dict)
kwargs = Dict() kwargs = Dict()
# get the full initargs, overriding any new settings # # get the full initargs, overriding any new settings
# TODO: should this be part of the main `plot` command in plot.jl??? # # TODO: should this be part of the main `plot` command in plot.jl???
d = merge!(plt.initargs, d) # d = merge!(plt.initargs, d)
# hide the legend? # hide the legend?
if !get(d, :legend, true) if !get(d, :legend, true)

View File

@ -87,6 +87,9 @@ convertColor(c::@compat(Union{AbstractString, Symbol})) = parse(Colorant, string
convertColor(c::Colorant) = c convertColor(c::Colorant) = c
convertColor(cvec::AbstractVector) = map(convertColor, cvec) convertColor(cvec::AbstractVector) = map(convertColor, cvec)
# backup... try to convert
getColor(c) = convertColor(c)
# -------------------------------------------------------------- # --------------------------------------------------------------
abstract ColorScheme abstract ColorScheme

View File

@ -139,7 +139,10 @@ function plot!(plt::Plot, args...; kw...)
dumpdict(d, "Updating plot items") dumpdict(d, "Updating plot items")
# add title, axis labels, ticks, etc # add title, axis labels, ticks, etc
if !haskey(d, :subplot)
d = merge!(plt.initargs, d)
updatePlotItems(plt, d) updatePlotItems(plt, d)
end
current(plt) current(plt)
# NOTE: lets ignore the show param and effectively use the semicolon at the end of the REPL statement # NOTE: lets ignore the show param and effectively use the semicolon at the end of the REPL statement

View File

@ -288,7 +288,12 @@ function postprocessSubplot(subplt::Subplot, d::Dict)
# add title, axis labels, ticks, etc # add title, axis labels, ticks, etc
for (i,plt) in enumerate(subplt.plts) for (i,plt) in enumerate(subplt.plts)
di = copy(d) # di = copy(d)
# get the full initargs, overriding any new settings
# TODO: should this be part of the main `plot` command in plot.jl???
di = merge!(plt.initargs, copy(d))
for (k,v) in di for (k,v) in di
if typeof(v) <: AVec if typeof(v) <: AVec
di[k] = v[mod1(i, length(v))] di[k] = v[mod1(i, length(v))]

View File

@ -126,14 +126,16 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, sigma = [1
# run the comparison test... a difference will throw an error # run the comparison test... a difference will throw an error
# NOTE: sigma is a 2-length vector with x/y values for the number of pixels # NOTE: sigma is a 2-length vector with x/y values for the number of pixels
# to blur together when comparing images # to blur together when comparing images
Images.test_approx_eq_sigma_eps(tmpimg, refimg, sigma, eps) diffpct = Images.test_approx_eq_sigma_eps(tmpimg, refimg, sigma, eps)
# we passed! # we passed!
info("Reference image $reffn matches") info("Reference image $reffn matches. Difference: $diffpct")
return true return true
catch ex catch err
warn("Image did not match reference image $reffn. err: $ex") warn("Image did not match reference image $reffn. err: $err")
showerror(Base.STDERR, err)
if isinteractive() if isinteractive()
# if we're in interactive mode, open a popup and give us a chance to examine the images # if we're in interactive mode, open a popup and give us a chance to examine the images
@ -144,7 +146,7 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, sigma = [1
else else
# if we rejected the image, or if we're in automated tests, throw the error # if we rejected the image, or if we're in automated tests, throw the error
rethrow(ex) rethrow(err)
end end
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -35,7 +35,7 @@ srand(1234)
# plot(x::AMat, y::AMat; kw...) # multiple lines (one per column of x/y... will assert size(x) == size(y)) # 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) @fact plot!(rand(10,3), rand(10,3)) --> not(nothing)
image_comparison_tests(:gadfly, skip=[19], eps=1e-2) image_comparison_tests(:gadfly, skip=[4,19], eps=1e-2)
end end
# catch err # catch err