From 44079a7bf7cda370dff4e381090ec5ae9fa0c019 Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Sun, 24 Apr 2016 22:47:32 -0400 Subject: [PATCH] added normalize kw, and added to pyplot --- src/args.jl | 4 ++++ src/backends/pyplot.jl | 2 +- src/backends/supported.jl | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/args.jl b/src/args.jl index 4bee3e40..e5665c96 100644 --- a/src/args.jl +++ b/src/args.jl @@ -154,6 +154,7 @@ _seriesDefaults[:xerror] = nothing _seriesDefaults[:yerror] = nothing _seriesDefaults[:ribbon] = nothing _seriesDefaults[:quiver] = nothing +_seriesDefaults[:normalize] = false # do we want a normalized histogram? const _plotDefaults = KW() @@ -356,6 +357,9 @@ end :velocity => :quiver, :quiver2d => :quiver, :gradient => :quiver, + :norm => :normalize, + :normed => :normalize, + :normalized => :normalize, ) # add all pluralized forms to the _keyAliases dict diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index a934366e..80ed3772 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -449,7 +449,7 @@ function _add_series(pkg::PyPlotBackend, plt::Plot, d::KW) edgecolor = pylinecolor(d), linewidth = d[:linewidth], bins = d[:nbins], - normed = (lt == :density), + normed = d[:normalize], orientation = (isvertical(d) ? "vertical" : "horizontal"), histtype = (d[:bar_position] == :stack ? "barstacked" : "bar") )[1] diff --git a/src/backends/supported.jl b/src/backends/supported.jl index 282918a5..ddd58a8b 100644 --- a/src/backends/supported.jl +++ b/src/backends/supported.jl @@ -101,12 +101,13 @@ supportedArgs(::PyPlotBackend) = [ :orientation, :overwrite_figure, :polar, + :normalize, ] supportedAxes(::PyPlotBackend) = _allAxes supportedTypes(::PyPlotBackend) = [ :none, :line, :path, :steppre, :steppost, :shape, :scatter, :hist2d, :hexbin, :hist, :density, - :bar, :box, :violin, :quiver, + :bar, :sticks, :box, :violin, :quiver, :hline, :vline, :heatmap, :contour, :path3d, :scatter3d, :surface, :wireframe ]