From e92fbadc3ada19f4162454451961cfe9eebdbde3 Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Wed, 23 Aug 2017 19:53:33 +0200 Subject: [PATCH 1/4] Update histogram normalization desc --- src/arg_desc.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arg_desc.jl b/src/arg_desc.jl index 2aad42a5..51ae0d80 100644 --- a/src/arg_desc.jl +++ b/src/arg_desc.jl @@ -40,7 +40,7 @@ const _arg_desc = KW( :ribbon => "Number or AbstractVector. Creates a fillrange around the data points.", :quiver => "AbstractVector or 2-Tuple of vectors. The directional vectors U,V which specify velocity/gradient vectors for a quiver plot.", :arrow => "nothing (no arrows), Bool (if true, default arrows), Arrow object, or arg(s) that could be style or head length/widths. Defines arrowheads that should be displayed at the end of path line segments (just before a NaN and the last non-NaN point). Used in quiverplot, streamplot, or similar.", -:normalize => "Bool or Symbol. Histogram normalization mode. Possible values are: false/:none (no normalization, default), true/:pdf (normalize to a PDF with integral of 1) and :density (only normalize in respect to bin sizes).", +:normalize => "Bool or Symbol. Histogram normalization mode. Possible values are: false/:none (no normalization, default), true/:pdf (normalize to a discrete Probability Density Function, where the total area of the bins is 1), :probability (bin heights sum to 1) and :density (the area of each bin, rather than the height, is equal to the counts - useful for uneven bin sizes).", :weights => "AbstractVector. Used in histogram types for weighted counts.", :contours => "Bool. Add contours to the side-grids of 3D plots? Used in surface/wireframe.", :match_dimensions => "Bool. For heatmap types... should the first dimension of a matrix (rows) correspond to the first dimension of the plot (x-axis)? The default is false, which matches the behavior of Matplotlib, Plotly, and others. Note: when passing a function for z, the function should still map `(x,y) -> z`.", From 62694e4a9382e5efab387bf86e86f7a3c1e4ac63 Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Thu, 31 Aug 2017 23:19:00 +0200 Subject: [PATCH 2/4] Make Freedman-Diaconis the default --- src/recipes.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/recipes.jl b/src/recipes.jl index 393bc2d4..0708667f 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -510,8 +510,10 @@ function _auto_binning_nbins{N}(vs::NTuple{N,AbstractVector}, dim::Integer; mode v = vs[dim] if mode == :auto - 30 - elseif mode == :sqrt # Square-root choice + mode == :fd + end + + if mode == :sqrt # Square-root choice _cl(sqrt(n)) elseif mode == :sturges # Sturges' formula _cl(log2(n)) + 1 @@ -550,7 +552,7 @@ end @recipe function f(::Type{Val{:histogram}}, x, y, z) - seriestype := :barhist + seriestype := length(y) > 1e6 ? :stephist : :barhist () end @deps histogram barhist From cd1913c00886e1c5ccc0c1e06ea7aee8bdb83efc Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Thu, 31 Aug 2017 23:20:55 +0200 Subject: [PATCH 3/4] Update bins description --- src/arg_desc.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arg_desc.jl b/src/arg_desc.jl index 51ae0d80..8634eabb 100644 --- a/src/arg_desc.jl +++ b/src/arg_desc.jl @@ -21,7 +21,7 @@ const _arg_desc = KW( :markerstrokewidth => "Number. Width of the marker stroke (border. in pixels)", :markerstrokecolor => "Color Type. Color of the marker stroke (border). `:match` will take the value from `:foreground_color_subplot`.", :markerstrokealpha => "Number in [0,1]. The alpha/opacity override for the marker stroke (border). `nothing` (the default) means it will take the alpha value of markerstrokecolor.", -:bins => "Integer, NTuple{2,Integer}, AbstractVector or Symbol. Default is :auto. For histogram-types, defines the approximate number of bins to aim for, or the auto-binning algorithm to use (:sturges, :sqrt, :rice, :scott or :fd). For fine-grained control pass a Vector of break values, e.g. `linspace(extrema(x)..., 25)`", +:bins => "Integer, NTuple{2,Integer}, AbstractVector or Symbol. Default is :auto (the Freedman-Diaconis rule). For histogram-types, defines the approximate number of bins to aim for, or the auto-binning algorithm to use (:sturges, :sqrt, :rice, :scott or :fd). For fine-grained control pass a Vector of break values, e.g. `linspace(extrema(x)..., 25)`", :smooth => "Bool. Add a regression line?", :group => "AbstractVector. Data is split into a separate series, one for each unique value in `group`.", :x => "Various. Input data. First Dimension", From d77be82a99a55c468990e8a056fc28b4d6be31c0 Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Fri, 1 Sep 2017 10:36:44 +0200 Subject: [PATCH 4/4] fix classic typo --- src/recipes.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/recipes.jl b/src/recipes.jl index 0708667f..d4d1b201 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -510,7 +510,7 @@ function _auto_binning_nbins{N}(vs::NTuple{N,AbstractVector}, dim::Integer; mode v = vs[dim] if mode == :auto - mode == :fd + mode = :fd end if mode == :sqrt # Square-root choice