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

Skip to content

Commit 24c0e00

Browse files
committed
add __repr__ to GridSpecBase
1 parent b078643 commit 24c0e00

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/gridspec.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ def __init__(self, nrows, ncols, height_ratios=None, width_ratios=None):
4444
self.set_height_ratios(height_ratios)
4545
self.set_width_ratios(width_ratios)
4646

47+
def __repr__(self):
48+
return '{clsname}({nrows}, {ncols})'.format(
49+
clsname=self.__class__.__name__,
50+
nrows = self._nrows,
51+
ncols = self._ncols,
52+
)
53+
4754
def get_geometry(self):
4855
'get the geometry of the grid, e.g., 2,3'
4956
return self._nrows, self._ncols

0 commit comments

Comments
 (0)