@@ -128,35 +128,28 @@ def check(self):
128128 self ._check_optionals (num_exp )
129129 self ._check_defaults (num_exp )
130130
131- def plot (self , ignore_null = True , pop_name = True , buffer_deg = None ,
131+ def plot (self , ignore_zero = True , pop_name = True , buffer_deg = 1.0 ,
132132 ** kwargs ):
133133 """Plot exposures values sum binned over Earth's map.
134134
135135 Parameters:
136- ignore_null (bool, optional): flag to indicate if zero and negative
136+ ignore_zero (bool, optional): flag to indicate if zero and negative
137137 values are ignored in plot. Default: False
138138 pop_name (bool, optional): add names of the populated places
139139 buffer_deg (float, optional): border to add to coordinates.
140- Default: BUFFER_DEG=1 in plot module .
140+ Default: 1.0 .
141141 kwargs (optional): arguments for hexbin matplotlib function
142142
143143 Returns:
144144 matplotlib.figure.Figure, cartopy.mpl.geoaxes.GeoAxesSubplot
145145 """
146- if ignore_null :
147- pos_vals = self .value > 0
148- else :
149- pos_vals = np .ones ((self .value .size ,), dtype = bool )
150146 title = self .tag .join_descriptions ()
151147 cbar_label = 'Value (%s)' % self .value_unit
152148 if 'reduce_C_function' not in kwargs :
153149 kwargs ['reduce_C_function' ] = np .sum
154- if buffer_deg is not None :
155- return plot .geo_bin_from_array (self .value [pos_vals ], \
156- self .coord [pos_vals ], cbar_label , title , pop_name , buffer_deg ,\
157- ** kwargs )
158- return plot .geo_bin_from_array (self .value [pos_vals ], \
159- self .coord [pos_vals ], cbar_label , title , pop_name , ** kwargs )
150+
151+ return plot .geo_bin_from_array (self .value , self .coord , cbar_label ,
152+ title , pop_name , buffer_deg , ignore_zero , ** kwargs )
160153
161154 def read (self , files , descriptions = '' , var_names = None ):
162155 """Read and check exposures.
0 commit comments