【Python】绘制二维散点图
import matplotlib.pyplot as plt # 解决不能显示中文 plt.rcParams['font.sans-serif'] = ['SimHei'] plt.rcParams['axes.unicode_minus'] = False plt.title("二维散点图", fontsize=24) plt.xlim(xmax=9,xmin=0) plt.ylim(ymax=9,ymin=0) #点的坐标分别为[0, 0], [3, 8], [1, 1], [2, 2], [5, 3], [4, 8], [6, 3], [5, 4], [6, 4], [7, 5] plt.plot([0,3,1,2,5,4,6,5,6,7],[0,8,1,2,3,8,3,4,4,5],'ro') plt.savefig('testblueline.jpg')
本文来自博客园,作者:木子欢儿,转载请注明原文链接:https://www.cnblogs.com/HGNET/p/15351957.html