Skip to content

Commit

Permalink
Use default weight of None for the stats
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Oct 24, 2015
1 parent 3b3a125 commit 75ecfbd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ggplot/stats/stat.py
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion ggplot/stats/stat_bin.py
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion ggplot/stats/stat_bin_2d.py
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion ggplot/stats/stat_ydensity.py
Expand Up @@ -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()
Expand Down

0 comments on commit 75ecfbd

Please sign in to comment.