8000 Fix issue #4414 · Pull Request #6171 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix issue #4414 #6171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add fix for horizontal case
  • Loading branch information
XivL committed Mar 17, 2016
commit c16991fc2365ec7087acd60e2030e3752898feaa
22 changes: 13 additions & 9 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6234,15 +6234,19 @@ 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':
# If norm, autoscale axis
if normed:
Expand Down
0