Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7ef723e

Browse files
author
Phil Elson
committed
More investigation resulted in this correction to calculating the number of labels.
1 parent f08efd4 commit 7ef723e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/pylab_examples/contourf_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
CS3 = contourf(X, Y, Z, levels,
6666
colors = ('r', 'g', 'b'),
6767
origin=origin,
68-
extend='both', hatch=['/', '\\'])
68+
extend='both',
69+
hatches=['/', '\\'])
6970
# Our data range extends outside the range of levels; make
7071
# data below the lowest contour level yellow, and above the
7172
# highest level cyan:

lib/matplotlib/contour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def clabel(self, *args, **kwargs):
153153
self.rightside_up = kwargs.get('rightside_up', True)
154154
if len(args) == 0:
155155
levels = self.levels
156-
indices = range(len(levels)-1)
156+
indices = range(len(self.cvalues))
157157
elif len(args) == 1:
158158
levlabs = list(args[0])
159159
indices, levels = [], []

0 commit comments

Comments
 (0)