Visitar URL original
Fixing osx makefile by fgb · Pull Request #4 · matplotlib/matplotlib · GitHub
Skip to content
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
BUG: Don't alter current behaviour of autofmt_xdate
* Make sure that autofmt_xdate does the right thing when the figure
  contains a single Axes object that is not be derived from
  matplotlib.axes.SubplotBase.
  • Loading branch information
scottza authored and fgb committed Feb 23, 2011
commit b86140c8d72dc552a1614881824701fe42cc9398
25 changes: 16 additions & 9 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,22 @@ def autofmt_xdate(self, bottom=0.2, rotation=30, ha='right'):
*ha*
the horizontal alignment of the xticklabels
"""
for ax in self.get_axes():
if hasattr(ax, 'is_last_row') and ax.is_last_row():
for label in ax.get_xticklabels():
label.set_ha(ha)
label.set_rotation(rotation)
else:
for label in ax.get_xticklabels():
label.set_visible(False)
ax.set_xlabel('')
if len(self.axes)==1:
# Always operate on the ticklabels if there is a single
# Axes object in the figure.
for label in ax.get_xticklabels():
label.set_ha(ha)
label.set_rotation(rotation)
else:
for ax in self.get_axes():
if hasattr(ax, 'is_last_row') and ax.is_last_row():
for label in ax.get_xticklabels():
label.set_ha(ha)
label.set_rotation(rotation)
else:
for label in ax.get_xticklabels():
label.set_visible(False)
ax.set_xlabel('')

self.subplots_adjust(bottom=bottom)

Expand Down