diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 49d755ae1954..1be58211442d 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -6234,26 +6234,34 @@ def _normalize_input(inp, ename='input'): # adopted from adjust_x/ylim part of the bar method if orientation == 'horizontal': - xmin0 = max(_saved_bounds[0]*0.9, minimum) - xmax = self.dataLim.intervalx[1] - for m in n: - if np.sum(m) > 0: # make sure there are counts - xmin = np.amin(m[m != 0]) - # filter out the 0 height bins - xmin = max(xmin*0.9, minimum) if not input_empty else minimum - xmin = min(xmin0, xmin) - self.dataLim.intervalx = (xmin, xmax) + if normed: + self.set_autoscalex_on(True) + else: + xmin0 = max(_saved_bounds[0]*0.9, minimum) + xmax = self.dataLim.intervalx[1] + for m in n: + if np.sum(m) > 0: # make sure there are counts + xmin = np.amin(m[m != 0]) + # filter out the 0 height bins + xmin = max(xmin*0.9, + minimum) if not input_empty else minimum + xmin = min(xmin0, xmin) + self.dataLim.intervalx = (xmin, xmax) elif orientation == 'vertical': - ymin0 = max(_saved_bounds[1]*0.9, minimum) - ymax = self.dataLim.intervaly[1] - - for m in n: - if np.sum(m) > 0: # make sure there are counts - ymin = np.amin(m[m != 0]) - # filter out the 0 height bins - ymin = max(ymin*0.9, minimum) if not input_empty else minimum - ymin = min(ymin0, ymin) - self.dataLim.intervaly = (ymin, ymax) + # If norm, autoscale axis + if normed: + self.set_autoscaley_on(True) + else: + ymin0 = max(_saved_bounds[1]*0.9, minimum) + ymax = self.dataLim.intervaly[1] + for m in n: + if np.sum(m) > 0: # make sure there are counts + ymin = np.amin(m[m != 0]) + # filter out the 0 height bins + ymin = max(ymin*0.9, + minimum) if not input_empty else minimum + ymin = min(ymin0, ymin) + self.dataLim.intervaly = (ymin, ymax) if label is None: labels = [None]
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: