初始化import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import numpy as np
fig, ax = plt.subplots()
ax.set_title() # 设置图表标题
plt.savefig() # 以图片形式保存至本地目录
设置坐标轴属性设置坐标位置和标签ax.set_xlabel() # 设置坐标轴名称
ax.set_xticks() # 控制标签位置
ax.set_xlim() # 设置坐标轴范围
ax.set_xticklabels() # 控制标签内容
format='%d ms'
ticks = mtick.FormatStrFormatter(format)
ax.xaxis.set_major_formatter(ticks) # 格式化标签内容
ax.xaxis.set_tick_params() # 设置标签参数
ax.yaxis.tick_right() # 改变坐标轴位置
ax.minorticks_on() # 显示坐标轴小格
ax.set_xscale('log') # 设置对数坐标
阅读全文