In the following bubble chart, how can I:
Randomize the color of each bubble
Adjust the title (maybe upper) so it will not overlap with the graph tag on the far up left corner.
Here is my output:
Here is my code:
import matplotlib.pyplot as plt
N=5
province=['Ontario','Quebec','BritishColumbia','Manitoba','NovaScoti']
size = [908.607,1356.547,922.509,552.329,651.036]
population = [12851821,7903001,4400057,1208268,4160000]
injuries = [625,752,629,1255,630]
plt.scatter(size,population,s=injuries)
for i in range(N):
plt.annotate(province[i],xy=(size[i],population[i]))
plt.xlabel('Size(*1000km2)')
plt.ylabel('Population(ten million)')
plt.title('The Car Accidents Injuries Rate in 5 Canada Provinces')
plt.show