Python 显示脚本中的情节
我有一个脚本(不是IPython笔记本),它在最后生成一个绘图(通过pandasPython 显示脚本中的情节,python,pandas,plot,Python,Pandas,Plot,我有一个脚本(不是IPython笔记本),它在最后生成一个绘图(通过pandasDataFrame)。我的问题是,这样的情节没有表现出来 灵感来源于我的努力 fig, ax = plt.subplots() my_dataframe.plot(ax=ax) ax.show() 这是行不通的。我可以显示我的绘图的唯一方法是: plt.figure() my_dataframe.plot() plt.show() 但这也带来了一个我不想要的空数字。你试过了吗 fig, ax = plt.subp
DataFrame
)。我的问题是,这样的情节没有表现出来
灵感来源于我的努力
fig, ax = plt.subplots()
my_dataframe.plot(ax=ax)
ax.show()
这是行不通的。我可以显示我的绘图的唯一方法是:
plt.figure()
my_dataframe.plot()
plt.show()
但这也带来了一个我不想要的空数字。你试过了吗
fig, ax = plt.subplots()
my_dataframe.plot(ax=ax)
plt.show() # plt in place of ax
对于不习惯这些缩写的人:plt引用
import matplotlib.pyplot as plt