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

Skip to content

Commit 2cfb857

Browse files
author
Brian Mattern
committed
pep-8 compliance for rest of contour.py
1 parent d6a70a7 commit 2cfb857

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

lib/matplotlib/contour.py

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,8 @@ def labels(self, inline, inline_spacing):
633633
add_label = self.add_label
634634

635635
for icon, lev, fsize, cvalue in zip(
636-
self.labelIndiceList, self.labelLevelList, self.labelFontSizeList,
637-
self.labelCValueList):
636+
self.labelIndiceList, self.labelLevelList,
637+
self.labelFontSizeList, self.labelCValueList):
638638

639639
con = self.collections[icon]
640640
trans = con.get_transform()
@@ -902,12 +902,13 @@ def __init__(self, ax, *args, **kwargs):
902902
paths = self._make_paths(segs, kinds)
903903
# Default zorder taken from Collection
904904
zorder = kwargs.get('zorder', 1)
905-
col = mcoll.PathCollection(paths,
906-
antialiaseds=(self.antialiased,),
907-
edgecolors='none',
908-
alpha=self.alpha,
909-
transform=self.get_transform(),
910-
zorder=zorder)
905+
col = mcoll.PathCollection(
906+
paths,
907+
antialiaseds=(self.antialiased,),
908+
edgecolors='none',
909+
alpha=self.alpha,
910+
transform=self.get_transform(),
911+
zorder=zorder)
911912
self.ax.add_collection(col)
912913
self.collections.append(col)
913914
else:
@@ -921,13 +922,14 @@ def __init__(self, ax, *args, **kwargs):
921922
zip(self.levels, tlinewidths, tlinestyles, self.allsegs):
922923
# Default zorder taken from LineCollection
923924
zorder = kwargs.get('zorder', 2)
924-
col = mcoll.LineCollection(segs,
925-
antialiaseds=aa,
926-
linewidths=width,
927-
linestyle=[lstyle],
928-
alpha=self.alpha,
929-
transform=self.get_transform(),
930-
zorder=zorder)
925+
col = mcoll.LineCollection(
926+
segs,
927+
antialiaseds=aa,
928+
linewidths=width,
929+
linestyle=[lstyle],
930+
alpha=self.alpha,
931+
transform=self.get_transform(),
932+
zorder=zorder)
931933
col.set_label('_nolegend_')
932934
self.ax.add_collection(col, False)
933935
self.collections.append(col)
@@ -972,29 +974,27 @@ def legend_elements(self, variable_name='x', str_format=str):
972974
n_levels = len(self.collections)
973975

974976
for i, (collection, lower, upper) in enumerate(
975-
zip(self.collections,
976-
lowers, uppers)):
977-
patch = mpatches.Rectangle(
978-
(0, 0), 1, 1,
979-
facecolor=collection.get_facecolor()[0],
980-
hatch=collection.get_hatch(),
981-
alpha=collection.get_alpha(),
982-
)
983-
artists.append(patch)
984-
985-
lower = str_format(lower)
986-
upper = str_format(upper)
987-
988-
if i == 0 and self.extend in ('min', 'both'):
989-
labels.append(r'$%s \leq %s$' % (variable_name,
990-
lower))
991-
elif i == n_levels - 1 and self.extend in ('max', 'both'):
992-
labels.append(r'$%s > %s$' % (variable_name,
993-
upper))
994-
else:
995-
labels.append(r'$%s < %s \leq %s$' % (lower,
996-
variable_name,
997-
upper))
977+
zip(self.collections, lowers, uppers)):
978+
patch = mpatches.Rectangle(
979+
(0, 0), 1, 1,
980+
facecolor=collection.get_facecolor()[0],
981+
hatch=collection.get_hatch(),
982+
alpha=collection.get_alpha())
983+
artists.append(patch)
984+
985+
lower = str_format(lower)
986+
upper = str_format(upper)
987+
988+
if i == 0 and self.extend in ('min', 'both'):
989+
labels.append(r'$%s \leq %s$' % (variable_name,
990+
lower))
991+
elif i == n_levels - 1 and self.extend in ('max', 'both'):
992+
labels.append(r'$%s > %s$' % (variable_name,
993+
upper))
994+
else:
995+
labels.append(r'$%s < %s \leq %s$' % (lower,
996+
variable_name,
997+
upper))
998998
else:
999999
for collection, level in zip(self.collections, self.levels):
10001000

@@ -1033,7 +1033,7 @@ def _process_args(self, *args, **kwargs):
10331033

10341034
# Check length of allkinds.
10351035
if (self.allkinds is not None and
1036-
len(self.allkinds) != len(self.allsegs)):
1036+
len(self.allkinds) != len(self.allsegs)):
10371037
raise ValueError('allkinds has different length to allsegs')
10381038

10391039
# Determine x,y bounds and update axes data limits.
@@ -1411,7 +1411,7 @@ def _process_args(self, *args, **kwargs):
14111411
# if the transform is not trans data, and some part of it
14121412
# contains transData, transform the xs and ys to data coordinates
14131413
if (t != self.ax.transData and
1414-
any(t.contains_branch_seperately(self.ax.transData))):
1414+
any(t.contains_branch_seperately(self.ax.transData))):
14151415
trans_to_data = t - self.ax.transData
14161416
pts = (np.vstack([x.flat, y.flat]).T)
14171417
transformed_pts = trans_to_data.transform(pts)
@@ -1521,11 +1521,11 @@ def _check_xyz(self, args, kwargs):
15211521

15221522
if x.shape != z.shape:
15231523
raise TypeError("Shape of x does not match that of z: found "
1524-
"{0} instead of {1}.".format(x.shape, z.shape))
1524+
"{0} instead of {1}.".format(x.shape, z.shape))
15251525

15261526
if y.shape != z.shape:
15271527
raise TypeError("Shape of y does not match that of z: found "
1528-
"{0} instead of {1}.".format(y.shape, z.shape))
1528+
"{0} instead of {1}.".format(y.shape, z.shape))
15291529

15301530
else:
15311531

0 commit comments

Comments
 (0)