some fixes for subplots and imgcmp
@ -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"
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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))]
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 56 KiB |
@ -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
|
||||||
|
|||||||