源码:
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df = pd.read_excel('jifen.xlsx')
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['axes.unicode_minus']=False
x=df['年份']
print(x)
y=df['及格线']
print(y)
z=df['noting to do']
print(z)
w=df['work']
print(w)
q=df['work and shui']
print(q)
# 设置图框的大小
fig = plt.figure(figsize=(10,6))
# 绘图,做折线图
plt.plot(x,#x轴
y,#y轴
linestyle = '-', # 折线类型
linewidth = 2, # 折线宽度
color = 'steelblue', # 折线颜色
marker = 'o', # 点的形状
markersize = 6, # 点的大小
markeredgecolor='black', # 点的边框色
markerfacec