diff --git a/ggplot/stats/stat.py b/ggplot/stats/stat.py index 39d51a966..1ee8b8be8 100644 --- a/ggplot/stats/stat.py +++ b/ggplot/stats/stat.py @@ -73,7 +73,8 @@ def use_defaults(self, data): set(data.columns)) for ae in missing: - data[ae] = self.DEFAULT_AES[ae] + if self.DEFAULT_AES[ae] is not None: + data[ae] = self.DEFAULT_AES[ae] missing = (self.aes_params.viewkeys() - set(data.columns)) diff --git a/ggplot/stats/stat_bin.py b/ggplot/stats/stat_bin.py index 2751ad3cc..1fdae1dd8 100644 --- a/ggplot/stats/stat_bin.py +++ b/ggplot/stats/stat_bin.py @@ -18,7 +18,7 @@ class stat_bin(stat): 'width': 0.9, 'drop': False, 'right': False, 'binwidth': None, 'bins': None, 'origin': None, 'breaks': None} - DEFAULT_AES = {'y': '..count..', 'weight': 1} + DEFAULT_AES = {'y': '..count..', 'weight': None} CREATES = {'y', 'width'} def setup_params(self, data): diff --git a/ggplot/stats/stat_bin_2d.py b/ggplot/stats/stat_bin_2d.py index e053b148f..b4378b5b9 100644 --- a/ggplot/stats/stat_bin_2d.py +++ b/ggplot/stats/stat_bin_2d.py @@ -19,7 +19,7 @@ class stat_bin_2d(stat): DEFAULT_PARAMS = {'geom': 'rect', 'position': 'identity', 'bins': 30, 'breaks': None, 'origin': None, 'binwidth': None, 'drop': True} - DEFAULT_AES = {'fill': '..count..', 'weight': 1} + DEFAULT_AES = {'fill': '..count..', 'weight': None} CREATES = {'xmin', 'xmax', 'ymin', 'ymax', 'fill'} def setup_params(self, data): diff --git a/ggplot/stats/stat_ydensity.py b/ggplot/stats/stat_ydensity.py index cf30a479f..a311b622d 100644 --- a/ggplot/stats/stat_ydensity.py +++ b/ggplot/stats/stat_ydensity.py @@ -16,7 +16,7 @@ class stat_ydensity(stat): 'adjust': 1, 'kernel': 'gaussian', 'n': 1024, 'trim': True, 'scale': 'area'} - DEFAULT_AES = {'weight': 1} + DEFAULT_AES = {'weight': None} def setup_params(self, data): params = self.params.copy()