Compare commits
No commits in common. "f82700765791220069db279a0607d85ad6e65152" and "60ae392ae39c9d24bd94752fefcc2a5f39f3f691" have entirely different histories.
f827007657
...
60ae392ae3
17
main.py
17
main.py
@ -5,7 +5,6 @@ from astrbot.api import logger
|
||||
import random
|
||||
from .back import time_long, volume, isUserExist, insertUser, seconds_to_hms, ml_to_l_ml, get_user_name
|
||||
import pymysql
|
||||
import matplotlib
|
||||
import matplotlib.pyplot as plt
|
||||
from .Tool import get_tool_name
|
||||
import astrbot.api.message_components as Comp
|
||||
@ -332,14 +331,14 @@ class MyPlugin(Star):
|
||||
for i in range(len(date)):
|
||||
day.append(date[i][0])
|
||||
volume.append(date[i][1])
|
||||
plt.plot(day, volume)
|
||||
plt.title('日产量')
|
||||
plt.xlabel('日期')
|
||||
plt.ylabel('日产量')
|
||||
plt.xticks(day)
|
||||
plt.grid()
|
||||
plt.savefig('dayvolume.png')
|
||||
plt.close()
|
||||
plt.pyplot.plot(day, volume)
|
||||
plt.pyplot.title('日产量')
|
||||
plt.pyplot.xlabel('日期')
|
||||
plt.pyplot.ylabel('日产量')
|
||||
plt.pyplot.xticks(day)
|
||||
plt.pyplot.grid()
|
||||
plt.pyplot.savefig('dayvolume.png')
|
||||
plt.pyplot.close()
|
||||
with open('dayvolume.png', 'rb') as f:
|
||||
image_data = f.read()
|
||||
image = Comp.Image.fromBytes(image_data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user