// Auto calculate max_bin if set
if type(max_bin) is str and (max_bin.upper() == "AUTO"):
maxval = round(np.nanmax(masked_array), 8) // Auto bins will detect maxval to use for calculating labels/bins
if type(min_bin) is str and (min_bin.upper() == "AUTO"):
b = round(np.nanmin(masked_array), 8) // If bin_min is auto then overwrite starting value
After Change
b = min_bin
// Calculate observed min and max pixel values of the masked array
observed_max = np.nanmax(masked_array)
observed_min = np.nanmin(masked_array)
// Auto calculate max_bin if set
if type(max_bin) is str and (max_bin.upper() == "AUTO"):
maxval = round(observed_max, 8) // Auto bins will detect maxval to use for calculating labels/bins
if type(min_bin) is str and (min_bin.upper() == "AUTO"):
b = round(observed_min, 8) // If bin_min is auto then overwrite starting value