我需要更改以下代码生成的绘图的图形大小。
import matplotlib.pyplot as plt
%matplotlib inline
df.index = df.Date
df.drop(["Date"], axis=1, inplace=True)
df.plot(kind="bar", stacked=True)
plt.xticks(rotation = 45)
plt.figure(figsize=(20,8))
plt.show()
在x轴上,我有100天的时间,目前无法轻松读取数据。我试图使用plt.figure,但是不幸的是,一切都没有改变。我该如何解决?
答案 0 :(得分:0)
尝试以下操作:
products_df.to_excel("C:\\Users\\gomes\\Desktop\\preços.xlsx")
命令df.plot()
答案 1 :(得分:0)
在调用plt.figure(figsize=(20,8))
函数之前尝试使用df.plot()
。
import matplotlib.pyplot as plt
%matplotlib inline
df.index = df.Date
df.drop(["Date"], axis=1, inplace=True)
plt.figure(figsize=(20,8))
df.plot(kind="bar", stacked=True)
plt.xticks(rotation = 45)
plt.show()