fonts opt update 02

This commit is contained in:
13339479676 2022-01-27 16:34:00 +08:00
parent 3929e81b2a
commit 91888ace76
1 changed files with 19 additions and 1 deletions

View File

@ -4,5 +4,23 @@
import os
import sys
import matplotlib.pyplot as plt
from matplotlib import font_manager
# 宋体
SimSun = font_manager.FontProperties(fname="./fonts/SimSun.ttc", size=12)
# 新罗马字体
TimesNesRoman = font_manager.FontProperties(
fname="./fonts/TimesNewRoman.ttf", size=12)
def create_chart(x, y, today):
# x, y为两个list
plt.plot(x, y, color='r', marker='o') # 线型
# plt.axis([0, 6, 0, 20])
plt.title('OpenCV Webcam Script v0.5', fontproperties=TimesNesRoman) # 标题
plt.xlabel(today, fontproperties=TimesNesRoman) # 横轴,时间
plt.ylabel('帧数', fontproperties=TimesNesRoman) # 纵轴,帧数
plt.savefig('test.png', dpi=100, bbox_inches='tight') # 保存图像
# plt.show()