test_plotwindow.py 文件源码

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

项目:yt 作者: yt-project 项目源码 文件源码
def test_set_background_color():
    ds = fake_random_ds(32)
    plot = SlicePlot(ds, 2, 'density')
    for field in ['density', ('gas', 'density')]:
        plot.set_background_color(field, 'red')
        ax = plot.plots[field].axes
        if LooseVersion(matplotlib.__version__) < LooseVersion('2.0.0'):
            assert_equal(ax.get_axis_bgcolor(), 'red')
        else:
            assert_equal(ax.get_facecolor(), (1.0, 0.0, 0.0, 1.0))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号