Reputation: 693
I have my x and y coordinates saved in variable x and y respectively. Below is the plot that I get when I make a scatter plot using x,y coordinates. The code used to make the plot is:
import matplotlib.pyplot as plt
for i in range(len(x)):
plt.scatter(x[i], y[i])
My question is that even though no color parameter was provided, plt.scatter automatically assigned different colors to the data points though the official documentation suggests that the default value is "b" as for "blue".
Upvotes: 1
Views: 429
Reputation: 10174
The default seems to be None
rather than b
(although the detailed description of the parameters tells differently).
From the doc: matplotlib.pyplot.scatter(x, y, s=None, c=None,...
So in your case you can fix it with:
for i in range(len(x)):
plt.scatter(x[i], y[i], c="b")
Upvotes: 1