plot.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:smp_base 作者: x75 项目源码 文件源码
def make_axes_from_grid(fig, gs):
    """Generate 2D array of subplot axes from a gridspec

    Args:
     - fig(matplotlib.figure.Figure): a matplotlib figure handle
     - gs(matplotlib.gridspec.GridSpec): the gridspec

    Returns:
     - list of lists (2D array) of subplot axes
    """
    axes = []
    (rows, cols) = gs.get_geometry()
    for row in range(rows):
        axes.append([])
        for col in range(cols):
            axes[-1].append(fig.add_subplot(gs[row, col]))
    return axes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号