phiplot.py 文件源码

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

项目:phiplot 作者: grahamfindlay 项目源码 文件源码
def plot_concept_list(constellation, fig=None, **kwargs):
    """Vertically stack a constellation's concept plots (uses `plot_concept`).

    Examples:
        >>> big_mip = pyphi.compute.big_mip(sub)
        >>> plot_concept_list(big_mip.unpartitioned_constellation,
                             title_fmt='MP', state_fmt='1')
        >>> matplotlib.pyplot.show()

    Args:
        constellation (list(pyphi.models.Concept)): A list of concepts to plot.

    Keyword args:
        fig (matplotlib.Figure): A figure on which to plot. If *None*, a new
            figure is created and used. Default *None*.
        Any unmatched kwargs are passed to `plot_concept`.
    """
    DEFAULT_WIDTH = 8 # in inches
    DEFAULT_CONCEPT_HEIGHT = 1.75 # in inches
    n_concepts = len(constellation)
    if fig is None:
        fig = plt.figure(1, (DEFAULT_WIDTH, DEFAULT_CONCEPT_HEIGHT * n_concepts))


    gs = gridspec.GridSpec(n_concepts, 1)

    for concept_idx in range(n_concepts):
        plot_concept(constellation[concept_idx],
                     fig=fig,
                     subplot_spec=gs[concept_idx, 0],
                     **kwargs)

    fig.tight_layout()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号