#PIL
from PIL import Image,ImageDraw
img=Image.new('RGB',(400,400),(255,255,255)) #白色
draw=ImageDraw.Draw(img)
#画线
draw.line((pos[a],pos[b]),fill=(255,0,0)) #红色
#写文字
draw.text((pos[a],pos[b]),people,(0,0,0)) #黑色
img.show()
#matplotlib
import math
import matplotlib.pyplot as plt
plt.figure(1)
plt.title("Figure1")
plt.xlabel("x", size=14)
plt.ylabel("y", size=14)
x = np.array([t for t in range(0, 100)])
y = [math.sin(t) for t in x]
#fitness = np.array(fitness)
plt.plot(x, y, color='b', linewidth=3)
for i in range(len(x)):
plt.text(x[i], y[i], i, color='red',fontsize=10)
plt.show()
#直方图
import matplotlib.pyplot as plt
import seaborn as sns
color = sns.color_palette()
nt = orders['order_dow'].value_counts()
plt.figure(figsize=(12,6))
sns.barplot(cnt.index, cnt.values, alpha=0.8, color=color[3]) #alpha表示颜色的深浅
plt.xlabel('Day of Week', fontsize=12)
plt.ylabel('Order Num', fontsize=12)
plt.show()