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

Skip to content

Commit 01b5932

Browse files
committed
Change PEP8 violations
1 parent 9285372 commit 01b5932

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5200,8 +5200,8 @@ def _pcolorargs(funcname, *args, **kw):
52005200

52015201
if len(args) == 1:
52025202
C = np.asanyarray(args[0])
5203-
isBivari = (isinstance(norm, mcolors.BivariateNorm) or
5204-
isinstance(cmap, mcolors.BivariateColormap))
5203+
isBivari = isinstance(norm, (mcolors.BivariateNorm,
5204+
mcolors.BivariateColormap))
52055205
if (C.ndim == 3 and isBivari):
52065206
if cmap is None:
52075207
cmap = mcolors.BivariateColormap()
@@ -5219,8 +5219,8 @@ def _pcolorargs(funcname, *args, **kw):
52195219

52205220
if len(args) == 3:
52215221
X, Y, C = [np.asanyarray(a) for a in args]
5222-
isBivari = (isinstance(norm, mcolors.BivariateNorm) or
5223-
isinstance(cmap, mcolors.BivariateColormap))
5222+
isBivari = isinstance(norm, (mcolors.BivariateNorm,
5223+
mcolors.BivariateColormap))
52245224
if (C.ndim == 3 and isBivari):
52255225
if cmap is None:
52265226
cmap = mcolors.BivariateColormap()
@@ -5772,8 +5772,8 @@ def pcolorfast(self, *args, **kwargs):
57725772

57735773
C = np.asarray(args[-1])
57745774

5775-
isBivari = (isinstance(norm, mcolors.BivariateNorm) or
5776-
isinstance(cmap, mcolors.BivariateColormap))
5775+
isBivari = isinstance(norm, (mcolors.BivariateNorm,
5776+
mcolors.BivariateColormap))
57775777
if (C.ndim == 3 and isBivari):
57785778
C = norm(C)
57795779
nr, nc = C.shape

lib/matplotlib/colorbar.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,9 @@ def remove(self):
901901

902902

903903
class ColorsquareBase(cm.ScalarMappable):
904+
904905
n_rasterize = 50 # rasterize solids if number of colors >= n_rasterize
906+
905907
def __init__(self, ax, cmap=None,
906908
norm=None,
907909
alpha=None,
@@ -1069,9 +1071,9 @@ def _set_label(self):
10691071
self.stale = True
10701072

10711073
def set_label(self, xlabel, ylabel, **kw):
1072-
'''
1074+
"""
10731075
Label the axes of the colorbar
1074-
'''
1076+
"""
10751077
self._xlabel = '%s' % (xlabel, )
10761078
self._ylabel = '%s' % (ylabel, )
10771079
self._labelkw = kw
@@ -1086,10 +1088,10 @@ def _edges(self, X, Y):
10861088
+ [list(zip(Y[i], X[i])) for i in xrange(1, N - 1)]
10871089

10881090
def _add_solids(self, X, Y, C):
1089-
'''
1091+
"""
10901092
Draw the colors using :meth:`~matplotlib.axes.Axes.pcolormesh`;
10911093
optionally add separators.
1092-
'''
1094+
"""
10931095
args = (X, Y, C)
10941096
kw = dict(cmap=self.cmap,
10951097
norm=self.norm,
@@ -1120,10 +1122,10 @@ def _add_solids(self, X, Y, C):
11201122
self.solids.set_rasterized(True)
11211123

11221124
def _ticker(self, norm):
1123-
'''
1125+
"""
11241126
Return the sequence of ticks (colorbar data locations),
11251127
ticklabels (strings), and the corresponding offset string.
1126-
'''
1128+
"""
11271129
if norm is self.norm.norm1:
11281130
_values = self._xvalues
11291131
_boundaries = self._xboundaries
@@ -1246,9 +1248,9 @@ def _process_values(self, b=None, norm=None):
12461248
return self._process_values(b=b, norm=norm)
12471249

12481250
def _mesh(self):
1249-
'''
1251+
"""
12501252
Return X,Y, the coordinate arrays for the colorbar pcolormesh.
1251-
'''
1253+
"""
12521254
x = np.linspace(0, 1, len(self._xboundaries))
12531255
y = np.linspace(0, 1, len(self._yboundaries))
12541256
self._x = x
@@ -1257,10 +1259,10 @@ def _mesh(self):
12571259
return X, Y
12581260

12591261
def _locate(self, x, norm):
1260-
'''
1262+
"""
12611263
Given a set of color data values, return their
12621264
corresponding colorbar data coordinates.
1263-
'''
1265+
"""
12641266
if norm is self.norm.norm1:
12651267
boundaries = self._xboundaries
12661268
else:
@@ -1300,6 +1302,7 @@ def remove(self):
13001302
fig = self.ax.figure
13011303
fig.delaxes(self.ax)
13021304

1305+
13031306
class Colorbar(ColorbarBase):
13041307
"""
13051308
This class connects a :class:`ColorbarBase` to a

0 commit comments

Comments
 (0)