Skip to content

Commit 03b2c31

Browse files
committed
Colormap that handles gridspec
1 parent 71a41df commit 03b2c31

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lib/matplotlib/colorbar.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,8 +1242,8 @@ def make_axes_gridspec(parents, **kw):
12421242
# map the extent of the gridspec from indices to rows and columns.
12431243
# We need this below to assign the parents into the new gridspec.
12441244
ncols0 = gsp0.get_geometry()[1]
1245-
minrow,mincol=index2rowcolunm(minind,ncols0)
1246-
maxrow,maxcol=index2rowcolunm(maxind,ncols0)
1245+
minrow, mincol = index2rowcolunm(minind, ncols0)
1246+
maxrow, maxcol = index2rowcolunm(maxind, ncols0)
12471247
nrows = maxrow-minrow+1
12481248
ncols = maxcol-mincol+1
12491249

@@ -1298,25 +1298,25 @@ def make_axes_gridspec(parents, **kw):
12981298
gsnew = gs_from_subplotspec(nrows, ncols, subplot_spec=gs[0])
12991299

13001300
for parent in parents:
1301-
geo=parent.get_subplotspec().get_geometry()
1301+
geo = parent.get_subplotspec().get_geometry()
13021302
ncol0 = geo[1]
13031303

13041304
# remap the old min gridspec index (geo[2]) into a new
13051305
# index.
1306-
oldrow,oldcol = index2rowcolunm(geo[2],ncol0)
1307-
newrow = oldrow-minrow+1
1308-
newcol = oldcol-mincol+1
1309-
newminind = rowcolunm2index(newrow,newcol,ncols)
1306+
oldrow, oldcol = index2rowcolunm(geo[2], ncol0)
1307+
newrow = oldrow - minrow+1
1308+
newcol = oldcol - mincol+1
1309+
newminind = rowcolunm2index(newrow, newcol, ncols)
13101310

13111311
# remap the old max gridspec index (geo[3]) into a new
13121312
# index.
1313-
oldrow,oldcol = index2rowcolunm(geo[3],ncol0)
1314-
newrow = oldrow-minrow+1
1315-
newcol = oldcol-mincol+1
1316-
newmaxind = rowcolunm2index(newrow,newcol,ncols)
1313+
oldrow, oldcol = index2rowcolunm(geo[3], ncol0)
1314+
newrow = oldrow - minrow+1
1315+
newcol = oldcol - mincol+1
1316+
newmaxind = rowcolunm2index(newrow, newcol, ncols)
13171317

13181318
# change the subplotspec for this parent.
1319-
parent.set_subplotspec(gridspec.SubplotSpec(gsnew,newminind,newmaxind))
1319+
parent.set_subplotspec(gridspec.SubplotSpec(gsnew, newminind, newmaxind))
13201320
parent.update_params()
13211321
parent.set_position(parent.figbox)
13221322
parent.set_anchor(panchor)

0 commit comments

Comments
 (0)