matplotlib:更改茎图线宽 [英] matplotlib: change stem plot linewidth

查看:77
本文介绍了matplotlib:更改茎图线宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的图像包含4个子图:

i have image containing 4 subplots:

    #!/usr/bin/env python3
    import matplotlib.pyplot as plt
    f, axarr = plt.subplots(2, 2) 
    axarr[0,1].stem([1,3,-4],linefmt='b-', markerfmt='bs', basefmt='k-')
    plt.show()

我想更改一个图(干图)的线宽.有没有简单的方法可以做到这一点?

I want to change the linewidth of one plot (stem plot). Is there an easy way to do this?

推荐答案

这是我的解决方案:

 markerline, stemlines, baseline = plt.stem(x, y)
 plt.setp(stemlines, 'linewidth', 3)

这篇关于matplotlib:更改茎图线宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆