Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Histogram improvements #1836

Merged
merged 15 commits into from Oct 31, 2017
Merged
Diff settings

Always

Just for now

add histogram option to normalize heights

  • Loading branch information...
timothydmorton authored and Philipp Rudiger committed Aug 4, 2017
commit 24ba5e4e5c46285f6f6cdde67c2dbd527395744f
@@ -486,6 +486,9 @@ class histogram(Operation):
groupby = param.ClassSelector(default=None, class_=(basestring, Dimension), doc="""
Defines a dimension to group the Histogram returning an NdOverlay of Histograms.""")

height_normed = param.Boolean(default=False, doc="""
Whether the histogram frequencies are normalized such that max height is unity.""")

individually = param.Boolean(default=True, doc="""
Specifies whether the histogram will be rescaled for each Element in a UniformNdMapping.""")

@@ -568,8 +571,8 @@ def _process(self, view, key=None):
hist, edges = np.histogram(data, normed=normed, range=hist_range,
weights=weights, bins=edges)
if self.p.weight_dimension and self.p.mean_weighted:
hist_mean, _ = np.histogram(data, normed=normed,
range=hist_range, bins=self.p.num_bins)
hist_mean, _ = np.histogram(data, density=False, range=hist_range,
bins=self.p.num_bins)
hist /= hist_mean
else:
hist = np.zeros(self.p.num_bins)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.