Skip to content

Commit

Permalink
Merge pull request #2667 from dopplershift/fix-matplotlib-3.6
Browse files Browse the repository at this point in the history
MNT: Update SkewXAxis for Matplotlib 3.6
  • Loading branch information
dopplershift authored Sep 16, 2022
2 parents 1f23c9a + 7cb5823 commit 01f4e2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/metpy/plots/skewt.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,16 @@ def _get_tick(self, major):
return SkewXTick(self.axes, None, major=major)

# Needed to properly handle tight bbox
def _get_tick_bboxes(self, ticks, renderer):
def _get_ticklabel_bboxes(self, ticks, renderer):
"""Return lists of bboxes for ticks' label1's and label2's."""
return ([tick.label1.get_window_extent(renderer)
for tick in ticks if tick.label1.get_visible() and tick.lower_in_bounds],
[tick.label2.get_window_extent(renderer)
for tick in ticks if tick.label2.get_visible() and tick.upper_in_bounds])

# Older name used on Matplotlib < 3.6
_get_tick_bboxes = _get_ticklabel_bboxes

def get_view_interval(self):
"""Get the view interval."""
return self.axes.upper_xlim[0], self.axes.lower_xlim[1]
Expand Down

0 comments on commit 01f4e2d

Please sign in to comment.