Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

matplotlib: change stem plot linewidth

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?

like image 337
Mike S. Avatar asked Mar 14 '23 14:03

Mike S.


1 Answers

Here is my solution:

 markerline, stemlines, baseline = plt.stem(x, y)
 plt.setp(stemlines, 'linewidth', 3)
like image 181
Louic Avatar answered Mar 17 '23 04:03

Louic