matplotlib: change stem plot linewidth

扶醉桌前 提交于 2021-02-07 17:23:38

问题


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?


回答1:


Here is my solution:

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


来源:https://stackoverflow.com/questions/32953201/matplotlib-change-stem-plot-linewidth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!