Skip to content

Commit

Permalink
don't support mpl v1.2 (#3941)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcomer authored Feb 10, 2021
1 parent 9317133 commit e378eb8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions docs/gallery_code/meteorology/plot_deriving_phenomena.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@ def limit_colorbar_ticks(contour_object):
number of ticks on the colorbar to 4.
"""
# Under Matplotlib v1.2.x the colorbar attribute of a contour object is
# a tuple containing the colorbar and an axes object, whereas under
# Matplotlib v1.3.x it is simply the colorbar.
try:
colorbar = contour_object.colorbar[0]
except (AttributeError, TypeError):
colorbar = contour_object.colorbar

colorbar = contour_object.colorbar
colorbar.locator = matplotlib.ticker.MaxNLocator(4)
colorbar.update_ticks()

Expand Down

0 comments on commit e378eb8

Please sign in to comment.