Skip to content
Merged
Changes from all commits
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
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