def get_gridspec(self, figure, nmr_plots):
rows = self.rows
cols = self.cols
if rows is None and cols is None:
return AutoGridLayout(spacings=self.spacings).get_gridspec(figure, nmr_plots)
if rows is None:
rows = int(np.ceil(nmr_plots / cols))
if cols is None:
cols = int(np.ceil(nmr_plots / rows))
if rows * cols < nmr_plots:
cols = int(np.ceil(nmr_plots / rows))
return GridLayoutSpecifier(GridSpec(rows, cols, **self.spacings), figure)
评论列表
文章目录