Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

matplotlib pyplot.plot() marker colors

The code:

plt.plot(x,"g.")
plt.show()

generates: enter image description here

When I try to specify colors in another way, lines are added:

plt.plot(x,"darkgreen",marker=".")
plt.show()

enter image description here

I don't need the lines. How can I use colors apart from the single character codes, without having the lines added to the plot?

like image 419
IamTheWalrus Avatar asked Sep 28 '26 00:09

IamTheWalrus


1 Answers

Set linestyle to "None":

plt.plot(x,color="darkgreen",marker=".", linestyle="None")
like image 146
user8153 Avatar answered Sep 29 '26 20:09

user8153



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!