上篇文章介绍了使用matplotlib绘制折线图,参考:Python matplotlib绘制折线图,本篇文章继续介绍使用matplotlib绘制散点图。...一、matplotlib绘制散点图
# coding=utf-8
import matplotlib.pyplot as plt
years = [2009, 2010, 2011, 2012, 2013...中绘制散点图的函数。...3200, 200))
plt.scatter(years, turnovers, c=np.random.randint(0, 50, 11), s=size, label='成交额')
plt.plot...(years, squares, color='red', label='x^3.3')
plt.plot(years, powers, color='blue', label='2^n')
plt.legend