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

Skip to content

Commit ef3a17a

Browse files
authored
Merge pull request matplotlib#14529 from anntzer/toolkitstyle
mpl_toolkits style fixes.
2 parents eca2854 + a9e05b0 commit ef3a17a

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

.flake8

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,8 @@ per-file-ignores =
4343
lib/matplotlib/transforms.py: E201, E202, E203
4444
lib/matplotlib/tri/triinterpolate.py: E201, E221
4545

46-
lib/mpl_toolkits/axes_grid1/axes_divider.py: E402, E501
4746
lib/mpl_toolkits/axes_grid1/axes_size.py: E272
48-
lib/mpl_toolkits/axes_grid1/colorbar.py: E225, E501
4947
lib/mpl_toolkits/axisartist/angle_helper.py: E221
50-
lib/mpl_toolkits/axisartist/clip_path.py: E225
51-
lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py: E225, E501
5248

5349
doc/conf.py: E402, E501
5450
doc/sphinxext/github.py: E302, E501

lib/mpl_toolkits/axes_grid1/axes_divider.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,8 @@ def new_vertical(self, size, pad=None, pack_start=False, **kwargs):
604604
locator = self.new_locator(nx=self._xrefindex, ny=0)
605605
else:
606606
self._vertical.append(size)
607-
locator = self.new_locator(nx=self._xrefindex, ny=len(self._vertical)-1)
607+
locator = self.new_locator(
608+
nx=self._xrefindex, ny=len(self._vertical)-1)
608609
ax = self._get_new_axes(**kwargs)
609610
ax.set_axes_locator(locator)
610611
return ax

lib/mpl_toolkits/axes_grid1/colorbar.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@
151151
cbar.solids.set_edgecolor("face")
152152
draw()
153153
154-
However this has negative consequences in other circumstances. Particularly with
155-
semi transparent images (alpha < 1) and colorbar extensions and is not enabled
156-
by default see (issue #1188).
154+
However this has negative consequences in other circumstances. Particularly
155+
with semi transparent images (alpha < 1) and colorbar extensions and is not
156+
enabled by default see (issue #1188).
157157
158158
returns:
159159
:class:`~matplotlib.colorbar.Colorbar` instance; see also its base class,
@@ -468,9 +468,9 @@ def _add_ends(self):
468468
del self.extension_patch2
469469

470470
path1, path2 = self.ax.get_axes_locator().get_path_ends()
471-
fc=mpl.rcParams['axes.facecolor']
472-
ec=mpl.rcParams['axes.edgecolor']
473-
linewidths=0.5*mpl.rcParams['axes.linewidth']
471+
fc = mpl.rcParams['axes.facecolor']
472+
ec = mpl.rcParams['axes.edgecolor']
473+
linewidths = 0.5 * mpl.rcParams['axes.linewidth']
474474
self.extension_patch1 = PathPatch(path1,
475475
fc=fc, ec=ec, lw=linewidths,
476476
zorder=2.,

lib/mpl_toolkits/axisartist/clip_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def clip(xlines, ylines, x0, clip="right", xdir=True, ydir=True):
3838
else:
3939
ns = -1
4040
segx, segy = [], []
41-
for (i,) in np.argwhere(db!=0):
41+
for (i,) in np.argwhere(db):
4242
c = db[i]
4343
if c == -1:
4444
dx = (x0 - x[i])

lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def transform_xy(x, y):
221221
xx1, yy1 = transform_xy(xx0, yy0)
222222

223223
xx00 = xx0.copy()
224-
xx00[xx0+dx>e1] -= dx
224+
xx00[xx0 + dx > e1] -= dx
225225
xx1a, yy1a = transform_xy(xx00, yy0)
226226
xx1b, yy1b = transform_xy(xx00+dx, yy0)
227227

@@ -240,7 +240,7 @@ def transform_xy(x, y):
240240
xx1b, yy1b = transform_xy(xx0, yy0+dy)
241241

242242
xx00 = xx0.copy()
243-
xx00[xx0+dx>e1] -= dx
243+
xx00[xx0 + dx > e1] -= dx
244244
xx2a, yy2a = transform_xy(xx00, yy0)
245245
xx2b, yy2b = transform_xy(xx00+dx, yy0)
246246

@@ -250,7 +250,7 @@ def transform_xy(x, y):
250250
def f1():
251251
dd = np.arctan2(yy1b-yy1a, xx1b-xx1a) # angle normal
252252
dd2 = np.arctan2(yy2b-yy2a, xx2b-xx2a) # angle tangent
253-
mm = (yy1b-yy1a == 0) & (xx1b-xx1a == 0) # mask where dd1 is not defined
253+
mm = (yy1b == yy1a) & (xx1b == xx1a) # mask where dd not defined
254254
dd[mm] = dd2[mm] + np.pi / 2
255255

256256
trans_tick = self.get_tick_transform(axes)
@@ -387,13 +387,15 @@ def get_tick_iterator(self, nth_coord, axis_side, minor=False):
387387
# angle = [0, 90, 180, 270][axisnr]
388388
lon_or_lat = ["lon", "lat"][nth_coord]
389389
if not minor: # major ticks
390-
for (xy, a), l in zip(self.grid_info[lon_or_lat]["tick_locs"][axis_side],
391-
self.grid_info[lon_or_lat]["tick_labels"][axis_side]):
390+
for (xy, a), l in zip(
391+
self.grid_info[lon_or_lat]["tick_locs"][axis_side],
392+
self.grid_info[lon_or_lat]["tick_labels"][axis_side]):
392393
angle_normal = a
393394
yield xy, angle_normal, angle_tangent, l
394395
else:
395-
for (xy, a), l in zip(self.grid_info[lon_or_lat]["tick_locs"][axis_side],
396-
self.grid_info[lon_or_lat]["tick_labels"][axis_side]):
396+
for (xy, a), l in zip(
397+
self.grid_info[lon_or_lat]["tick_locs"][axis_side],
398+
self.grid_info[lon_or_lat]["tick_labels"][axis_side]):
397399
angle_normal = a
398400
yield xy, angle_normal, angle_tangent, ""
399401
# for xy, a, l in self.grid_info[lon_or_lat]["ticks"][axis_side]:

0 commit comments

Comments
 (0)