Repository: holoviz/holoviews

Issue:
Set histogram operation to normed=False by default
This is the default in both numpy and matplotlib so we should follow it.


Discussion:
Sounds like a config option to me as this will break backwards compatibility otherwise.

Resolving patch:
diff --git a/holoviews/operation/element.py b/holoviews/operation/element.py
--- a/holoviews/operation/element.py
+++ b/holoviews/operation/element.py
@@ -668,7 +668,7 @@ class histogram(Operation):
     mean_weighted = param.Boolean(default=False, doc="""
       Whether the weighted frequencies are averaged.""")
 
-    normed = param.ObjectSelector(default=True,
+    normed = param.ObjectSelector(default=False,
                                   objects=[True, False, 'integral', 'height'],
                                   doc="""
       Controls normalization behavior.  If `True` or `'integral'`, then


Test patch:
diff --git a/holoviews/tests/operation/testoperation.py b/holoviews/tests/operation/testoperation.py
--- a/holoviews/tests/operation/testoperation.py
+++ b/holoviews/tests/operation/testoperation.py
@@ -141,7 +141,7 @@ def test_image_contours_filled(self):
 
     def test_points_histogram(self):
         points = Points([float(i) for i in range(10)])
-        op_hist = histogram(points, num_bins=3)
+        op_hist = histogram(points, num_bins=3, normed=True)
 
         hist = Histogram(([0, 3, 6, 9], [0.1, 0.1, 0.133333]),
                          vdims=('x_frequency', 'Frequency'))
@@ -151,7 +151,7 @@ def test_dataset_histogram_empty_explicit_bins(self):
         ds = Dataset([np.nan, np.nan], ['x'])
         op_hist = histogram(ds, bins=[0, 1, 2])
 
-        hist = Histogram(([0, 1, 2], [0, 0]), vdims=('x_frequency', 'Frequency'))
+        hist = Histogram(([0, 1, 2], [0, 0]), vdims=('x_count', 'Count'))
         self.assertEqual(op_hist, hist)
 
     @da_skip
@@ -159,7 +159,7 @@ def test_dataset_histogram_dask(self):
         import dask.array as da
         ds = Dataset((da.from_array(np.array(range(10), dtype='f'), chunks=(3)),),
                      ['x'], datatype=['dask'])
-        op_hist = histogram(ds, num_bins=3)
+        op_hist = histogram(ds, num_bins=3, normed=True)
 
         hist = Histogram(([0, 3, 6, 9], [0.1, 0.1, 0.133333]),
                          vdims=('x_frequency', 'Frequency'))
@@ -171,7 +171,7 @@ def test_dataset_cumulative_histogram_dask(self):
         import dask.array as da
         ds = Dataset((da.from_array(np.array(range(10), dtype='f'), chunks=(3)),),
                      ['x'], datatype=['dask'])
-        op_hist = histogram(ds, num_bins=3, cumulative=True)
+        op_hist = histogram(ds, num_bins=3, cumulative=True, normed=True)
 
         hist = Histogram(([0, 3, 6, 9], [0.3, 0.6, 1]),
                          vdims=('x_frequency', 'Frequency'))
@@ -184,7 +184,7 @@ def test_dataset_weighted_histogram_dask(self):
         ds = Dataset((da.from_array(np.array(range(10), dtype='f'), chunks=3),
                       da.from_array([i/10. for i in range(10)], chunks=3)),
                      ['x', 'y'], datatype=['dask'])
-        op_hist = histogram(ds, weight_dimension='y', num_bins=3)
+        op_hist = histogram(ds, weight_dimension='y', num_bins=3, normed=True)
 
         hist = Histogram(([0, 3, 6, 9], [0.022222, 0.088889, 0.222222]),
                          vdims='y')
@@ -193,7 +193,7 @@ def test_dataset_weighted_histogram_dask(self):
 
     def test_points_histogram_bin_range(self):
         points = Points([float(i) for i in range(10)])
-        op_hist = histogram(points, num_bins=3, bin_range=(0, 3))
+        op_hist = histogram(points, num_bins=3, bin_range=(0, 3), normed=True)
 
         hist = Histogram(([0.25, 0.25, 0.5], [0., 1., 2., 3.]),
                          vdims=('x_frequency', 'Frequency'))
@@ -226,7 +226,7 @@ def test_points_histogram_not_normed(self):
 
     def test_histogram_operation_datetime(self):
         dates = np.array([dt.datetime(2017, 1, i) for i in range(1, 5)])
-        op_hist = histogram(Dataset(dates, 'Date'), num_bins=4)
+        op_hist = histogram(Dataset(dates, 'Date'), num_bins=4, normed=True)
         hist_data = {
             'Date': np.array([
                 '2017-01-01T00:00:00.000000', '2017-01-01T18:00:00.000000',
@@ -241,7 +241,7 @@ def test_histogram_operation_datetime(self):
 
     def test_histogram_operation_datetime64(self):
         dates = np.array([dt.datetime(2017, 1, i) for i in range(1, 5)]).astype('M')
-        op_hist = histogram(Dataset(dates, 'Date'), num_bins=4)
+        op_hist = histogram(Dataset(dates, 'Date'), num_bins=4, normed=True)
         hist_data = {
             'Date': np.array([
                 '2017-01-01T00:00:00.000000', '2017-01-01T18:00:00.000000',
@@ -257,7 +257,7 @@ def test_histogram_operation_datetime64(self):
     @pd_skip
     def test_histogram_operation_pd_period(self):
         dates = pd.date_range('2017-01-01', '2017-01-04', freq='D').to_period('D')
-        op_hist = histogram(Dataset(dates, 'Date'), num_bins=4)
+        op_hist = histogram(Dataset(dates, 'Date'), num_bins=4, normed=True)
         hist_data = {
             'Date': np.array([
                 '2017-01-01T00:00:00.000000', '2017-01-01T18:00:00.000000',
@@ -272,13 +272,14 @@ def test_histogram_operation_pd_period(self):
 
     def test_points_histogram_weighted(self):
         points = Points([float(i) for i in range(10)])
-        op_hist = histogram(points, num_bins=3, weight_dimension='y')
+        op_hist = histogram(points, num_bins=3, weight_dimension='y', normed=True)
         hist = Histogram(([0.022222, 0.088889, 0.222222], [0, 3, 6, 9]), vdims=['y'])
         self.assertEqual(op_hist, hist)
 
     def test_points_histogram_mean_weighted(self):
         points = Points([float(i) for i in range(10)])
-        op_hist = histogram(points, num_bins=3, weight_dimension='y', mean_weighted=True)
+        op_hist = histogram(points, num_bins=3, weight_dimension='y',
+                            mean_weighted=True, normed=True)
         hist = Histogram(([1.,  4., 7.5], [0, 3, 6, 9]), vdims=['y'])
         self.assertEqual(op_hist, hist)
 
diff --git a/holoviews/tests/plotting/bokeh/testhistogramplot.py b/holoviews/tests/plotting/bokeh/testhistogramplot.py
--- a/holoviews/tests/plotting/bokeh/testhistogramplot.py
+++ b/holoviews/tests/plotting/bokeh/testhistogramplot.py
@@ -60,10 +60,8 @@ def test_histogram_datetime64_plot(self):
         hist = histogram(Dataset(dates, 'Date'), num_bins=4)
         plot = bokeh_renderer.get_plot(hist)
         source = plot.handles['source']
-        print(source.data)
         data = {
-            'top': np.array([
-                3.85802469e-18, 3.85802469e-18, 3.85802469e-18, 3.85802469e-18]),
+            'top': np.array([1, 1, 1, 1]),
             'left': np.array([
                 '2017-01-01T00:00:00.000000', '2017-01-01T18:00:00.000000',
                 '2017-01-02T12:00:00.000000', '2017-01-03T06:00:00.000000'],