Here is my code:
import numpy as np
import matplotlib.dates as mdates
fig, ax = plt.subplots(figsize = (10,10))
dateList = []
countries = []
casesList = []
colors = []
for e in sorted_date:
countries.append(e[0])
dateList.append(e[1][0])
casesList.append(e[1][1])
# plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%m/%d/%Y'))
for country, date, case in zip(countries, dateList, casesList):
ax.scatter(date, case, c = np.random.rand(3,), edgecolors='none', label=country )
plt.legend(loc=1)
plt.show()
My scatterplot works but I kept getting the error message for the color RGB or RGBA like this:
'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points.
I think there is something wrong with my randomizing the color but not sure what to fix it.