test_plotting.py 文件源码

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

项目:triage 作者: dssg 项目源码 文件源码
def test_generate_plot_lines():
    colordict = {
        'cat1': '#001122',
        'cat2': '#112233',
        'cat3': '#223344',
    }
    styledict = {
        'cat1': '-',
        'cat2': '--',
        'cat3': '-',
    }
    plot_lines = generate_plot_lines(colordict,
                                     lambda x: 'Cat {}'.format(x),
                                     styledict)
    assert len(plot_lines) == 3
    for line in plot_lines:
        assert type(line) == mlines.Line2D
        assert 'Cat ' in line._label
        assert '-' in line._linestyle
        if line._label == 'Cat 2':
            assert line._linestyle == '--'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号