> plt.text(zb[link],-1.2,year,ha='center')#需要根据自己的位置调整Y的坐标即调整-1
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签
plt.rcParams['axes.unicode_minus']=False #用来正常显示负号
time1 =input("输入一个时间(时、分、秒以空格分割):")
year = input('请输入年份,格式如 2019-8-30 :')
n = input('请输入X轴分段数:')
old_time_x = []
time1List = time1.split(" ")
time1List = [int(x) for x in time1List]
'''时间转化'''
shi = time1List[0]
fen = time1List[1]
miao = time1List[2]
for x in range(eval(n)+1):
time_x = '%02d:%02d:%02d'%(shi,fen,miao)
old_time_x.append(time_x)
miao += 60
while miao >= 60:
miao = miao - 60
fen += 1
while fen >= 60:
fen = fen -60
shi += 1
while shi > 24:
shi = shi - 24
print(old_time_x)
x = np.arange(0,10,1)
y = np.arange(0,10,1)
fig = plt.figure(figsize=(12,6))
plt.xticks(np.linspace(0,9,eval(n)),old_time_x,rotation=0)
zb = np.linspace(0,9,eval(n))
print(zb)
for link in range(len(zb)):
plt.text(zb[link],-1.2,year,ha='center')#需要根据自己的位置调整Y的坐标即调整-1
plt.plot(x,y)