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

Skip to content

Commit 979ecee

Browse files
author
shawnchen
committed
flake8 compliance
1 parent b356530 commit 979ecee

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

examples/color/colorbar_basics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# repeat everything above for the negative data
3535
# you can specifiy location, anchor and shrink the colorbar
3636
neg = ax2.imshow(Zneg, cmap='Reds_r', interpolation='none')
37-
fig.colorbar(neg, ax=ax2, location='right', anchor=(0,0.3), shrink=0.7)
37+
fig.colorbar(neg, ax=ax2, location='right', anchor=(0, 0.3), shrink=0.7)
3838

3939
# Plot both positive and negative values between +/- 1.2
4040
pos_neg_clipped = ax3.imshow(Z, cmap='RdBu', vmin=-1.2, vmax=1.2,

lib/matplotlib/colorbar.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,32 +1523,36 @@ def make_axes_gridspec(parent, *, location=None, orientation=None,
15231523
wh_ratios = [(1-anchor[1])*(1-shrink), shrink, anchor[1]*(1-shrink)]
15241524

15251525
if location == 'left':
1526-
gs = parent.get_subplotspec().subgridspec(
1527-
1, 2, wspace=wh_space, width_ratios=[fraction, 1-fraction-pad])
1526+
gs = parent.get_subplotspec().subgridspec(1, 2,
1527+
wspace=wh_space, width_ratios=[fraction, 1-fraction-pad])
15281528
ss_main = gs[1]
1529-
ss_cb = gs[0].subgridspec(3, 1, hspace=0, height_ratios=wh_ratios)[1]
1529+
ss_cb = gs[0].subgridspec(3, 1,
1530+
hspace=0, height_ratios=wh_ratios)[1]
15301531
else:
1531-
gs = parent.get_subplotspec().subgridspec(
1532-
1, 2, wspace=wh_space, width_ratios=[1-fraction-pad, fraction])
1532+
gs = parent.get_subplotspec().subgridspec(1, 2,
1533+
wspace=wh_space, width_ratios=[1-fraction-pad, fraction])
15331534
ss_main = gs[0]
1534-
ss_cb = gs[1].subgridspec(3, 1, hspace=0, height_ratios=wh_ratios)[1]
1535+
ss_cb = gs[1].subgridspec(3, 1,
1536+
hspace=0, height_ratios=wh_ratios)[1]
15351537
else:
15361538
# for shrinking
15371539
wh_ratios = [anchor[0]*(1-shrink), shrink, (1-anchor[0])*(1-shrink)]
15381540

15391541
if location == 'bottom':
1540-
gs = parent.get_subplotspec().subgridspec(
1541-
2, 1, hspace=wh_space, height_ratios=[1-fraction-pad, fraction])
1542+
gs = parent.get_subplotspec().subgridspec(2, 1,
1543+
hspace=wh_space, height_ratios=[1-fraction-pad, fraction])
15421544
ss_main = gs[0]
1543-
ss_cb = gs[1].subgridspec(1, 3, wspace=0, width_ratios=wh_ratios)[1]
1545+
ss_cb = gs[1].subgridspec(1, 3,
1546+
wspace=0, width_ratios=wh_ratios)[1]
15441547
aspect = 1 / aspect
15451548
else:
1546-
gs = parent.get_subplotspec().subgridspec(
1547-
2, 1, hspace=wh_space, height_ratios=[fraction, 1-fraction-pad])
1549+
gs = parent.get_subplotspec().subgridspec(2, 1,
1550+
hspace=wh_space, height_ratios=[fraction, 1-fraction-pad])
15481551
ss_main = gs[1]
1549-
ss_cb = gs[0].subgridspec(1, 3, wspace=0, width_ratios=wh_ratios)[1]
1552+
ss_cb = gs[0].subgridspec(1, 3,
1553+
wspace=0, width_ratios=wh_ratios)[1]
15501554
aspect = 1 / aspect
1551-
1555+
15521556
parent.set_subplotspec(ss_main)
15531557
parent.set_anchor(loc_settings["panchor"])
15541558

0 commit comments

Comments
 (0)