Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Baseline in Stem Plot

I am new-ish to Matplotlib.

I made a stem plot (aka lollipop) using Python/Matplotlib. These kinds of plots have style settings: linefmt, markerfmt, basefmt.

For instance, I can change the color of the baseline like so:

plt.stem(X, Y, basefmt="m")

I'd like to see the points and the stems, but I don't want to see the actual baseline. What command/format code do I need to "hide" the baseline? Or am I approaching this wrong?

like image 934
brian_o Avatar asked Oct 16 '15 17:10

brian_o


1 Answers

You can do it all in one line:

plt.stem(X, Y, basefmt=" ")

like image 143
aslan Avatar answered Sep 28 '22 10:09

aslan