added args and kwargs to PLOT_DEFAULTS

This commit is contained in:
Thomas Breloff 2015-09-13 14:06:33 -04:00
parent 9ea98bcb56
commit 31da90865c
2 changed files with 5 additions and 1 deletions

View File

@ -41,6 +41,10 @@ PLOT_DEFAULTS[:xticks] = true
PLOT_DEFAULTS[:yticks] = true PLOT_DEFAULTS[:yticks] = true
PLOT_DEFAULTS[:size] = (600,400) PLOT_DEFAULTS[:size] = (600,400)
PLOT_DEFAULTS[:args] = [] # additional args to pass to the backend
PLOT_DEFAULTS[:kwargs] = [] # additional keyword args to pass to the backend
# note: can be Vector{Dict} or Vector{Tuple}
# TODO: x/y scales # TODO: x/y scales

View File

@ -101,7 +101,7 @@ function plot!(::GadflyPackage, plt::Plot; kw...)
push!(plt.seriesargs, d) push!(plt.seriesargs, d)
# add the layer to the Gadfly.Plot # add the layer to the Gadfly.Plot
prepend!(plt.o.layers, Gadfly.layer(unique(gfargs)...; x = x, y = d[:y])) prepend!(plt.o.layers, Gadfly.layer(unique(gfargs)..., d[:args]...; x = x, y = d[:y], d[:kwargs]...))
plt plt
end end