赞
踩
如题目所述, 分享一个在图中增加网格线, 并且将x轴标签倾斜的python小程序. 小程序的源码如下:
- from 翻译包 import *
- import matplotlib
- import matplotlib.pyplot as plt
-
- font = {'size':26}
- matplotlib.rc('font', **font)
- markersize = 18
-
- 横坐标 = 范围(1, 9)
- 纵坐标 = [5, 8, 4, 2, 3, 1, 6, 4]
- 图标大小 = 100
- 线条宽度 = 2.0
- fig = plt.figure(1)
- plt.grid(linestyle=":")
- plt.scatter(横坐标, 纵坐标, label = "SF.sw", color = 'blue', \
- linewidths = 线条宽度, marker="^", s = 图标大小, facecolors="none")
- plt.xticks(横坐标, ["CAIDA", "Cmps", "ISP1", "ISP2", r"CAIDA$_{v6}$", r"Cmps$_{v6}$", r"ISP1$_{v6}$", r"ISP2$_{v6}$"], rotation=70)
- plt.xlabel("Traces")
- plt.ylabel("Throughput/Mpps")
- plt.savefig("测试.pdf", bbox_inches = "tight")
- plt.savefig("测试.png", bbox_inches = "tight")
- plt.savefig("测试.eps", bbox
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。