Skip to content

Commit

Permalink
don't support mpl v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rcomer committed Jan 27, 2021
1 parent 02777db commit 71c42e2
Showing 1 changed file with 1 addition and 8 deletions.
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 71c42e2

Please sign in to comment.