Skip to content

Commit 6e117ff

Browse files
author
shawnchen
committed
rename wh_ratios to height_ratios/width_ratios
1 parent 7e0207c commit 6e117ff

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/matplotlib/colorbar.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,41 +1516,43 @@ def make_axes_gridspec(parent, *, location=None, orientation=None,
15161516

15171517
if location in ('left', 'right'):
15181518
# for shrinking
1519-
wh_ratios = [(1-anchor[1])*(1-shrink), shrink, anchor[1]*(1-shrink)]
1519+
height_ratios = [
1520+
(1-anchor[1])*(1-shrink), shrink, anchor[1]*(1-shrink)]
15201521

15211522
if location == 'left':
15221523
gs = parent.get_subplotspec().subgridspec(
15231524
1, 2, wspace=wh_space,
15241525
width_ratios=[fraction, 1-fraction-pad])
15251526
ss_main = gs[1]
15261527
ss_cb = gs[0].subgridspec(
1527-
3, 1, hspace=0, height_ratios=wh_ratios)[1]
1528+
3, 1, hspace=0, height_ratios=height_ratios)[1]
15281529
else:
15291530
gs = parent.get_subplotspec().subgridspec(
15301531
1, 2, wspace=wh_space,
15311532
width_ratios=[1-fraction-pad, fraction])
15321533
ss_main = gs[0]
15331534
ss_cb = gs[1].subgridspec(
1534-
3, 1, hspace=0, height_ratios=wh_ratios)[1]
1535+
3, 1, hspace=0, height_ratios=height_ratios)[1]
15351536
else:
15361537
# for shrinking
1537-
wh_ratios = [anchor[0]*(1-shrink), shrink, (1-anchor[0])*(1-shrink)]
1538+
width_ratios = [
1539+
anchor[0]*(1-shrink), shrink, (1-anchor[0])*(1-shrink)]
15381540

15391541
if location == 'bottom':
15401542
gs = parent.get_subplotspec().subgridspec(
15411543
2, 1, hspace=wh_space,
15421544
height_ratios=[1-fraction-pad, fraction])
15431545
ss_main = gs[0]
15441546
ss_cb = gs[1].subgridspec(
1545-
1, 3, wspace=0, width_ratios=wh_ratios)[1]
1547+
1, 3, wspace=0, width_ratios=width_ratios)[1]
15461548
aspect = 1 / aspect
15471549
else:
15481550
gs = parent.get_subplotspec().subgridspec(
15491551
2, 1, hspace=wh_space,
15501552
height_ratios=[fraction, 1-fraction-pad])
15511553
ss_main = gs[1]
15521554
ss_cb = gs[0].subgridspec(
1553-
1, 3, wspace=0, width_ratios=wh_ratios)[1]
1555+
1, 3, wspace=0, width_ratios=width_ratios)[1]
15541556
aspect = 1 / aspect
15551557

15561558
parent.set_subplotspec(ss_main)

0 commit comments

Comments
 (0)