我在A4纸上绘制一些索引数据,用3x2行列的6幅图像绘制。我已经得到了基本的代码工作,它将这个数据帧数据绘制成以下6个图。在def plot_idx(df,image,key):
# reset the default parameters
plt.rcParams['font.size'] = 8.
plt.rcParams['figure.figsize'] = (8.267, 11.692) #aA paper
fig = plt.figure()
#plot all the 6 figures and save the 3x2 image as png
ax1 = fig.add_subplot(321) # first row first image
#compute all time
alltime = df['Close'].count()
x,y,x_min, y_min, x_max, y_max = min_max(df,alltime)
ax1.plot(x, y,'r')
ax1.plot(x_min,y_min,'o')
ax1.plot(x_max,y_max,'o')
ax1.set_xlabel('year')
ax1.set_ylabel('Index Close')
ax1.set_title(plot_title[-1])
ax1.fill_between(x,y,facecolor='red')
ax1.annotate(y_min, xy=(x_min,y_min), xytext=(x_min,y_min +