From 5090bf9132af7e4fa787be4f867de995cad67552 Mon Sep 17 00:00:00 2001 From: 13339479676 <zyfiy1314@163.com> Date: Fri, 28 Jan 2022 08:32:59 +0800 Subject: [PATCH] plot update 06 --- utils/plot.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/utils/plot.py b/utils/plot.py index 2726926..74b23f5 100644 --- a/utils/plot.py +++ b/utils/plot.py @@ -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)