plot update 06

This commit is contained in:
13339479676 2022-01-28 08:32:59 +08:00
parent 51c9a7c0fb
commit 5090bf9132
1 changed files with 7 additions and 4 deletions

View File

@ -15,6 +15,9 @@ SimSun = font_manager.FontProperties(fname="./fonts/SimSun.ttc", size=12)
TimesNesRoman = font_manager.FontProperties(
fname="./fonts/TimesNewRoman.ttf", size=12)
# 颜色列表
color_list = ['#f96801']
# 创建折线图
def createLineChart(frames_y, today):
@ -24,13 +27,13 @@ def createLineChart(frames_y, today):
today_date.append(today[i][0]) # 日期
today_time.append(today[i][1]) # 时间
# 设置画布大小
# 画布尺寸
plt.figure(figsize=(8, 4))
# 线型
plt.plot(today_time, frames_y, color='r', marker='o',
label='时间点', markerfacecolor='r', markersize=5)
plt.plot(today_time, frames_y, color=color_list[0], marker='o',
label='时间点', markerfacecolor=color_list[0], markersize=5)
# 设置数字标签
# 标签
for a, b in zip(today_time, frames_y):
plt.text(a, b, b, ha='center', va='bottom', fontsize=10.5)