matplotlib怎么在pycharm中绘制出来图
1个回答
展开全部
近看《Python数据析》本书自写代码直用Pycharm练习候碰plot()绘图能显示问题网翻找知乎篇答试像行且答住提供from pylab import *太符合编程规范Stackoverflow找想要答案特析给家:
问题代码能绘图功:
import pandas as pd
from numpy import *
import matplotlib.pyplot as plt
ts = pd.Series(random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
ts = ts.cumsum()
ts.plot()
解决案:导入matplotlib.pyplot库绘图再调用matplotlib.pyplot.show()能绘制图显示
(注:面发现知乎篇问答评论区提供):
import pandas as pd
from numpy import *
import matplotlib.pyplot as plt
ts = pd.Series(random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
ts = ts.cumsum()
ts.plot()
plt.show()
问题代码能绘图功:
import pandas as pd
from numpy import *
import matplotlib.pyplot as plt
ts = pd.Series(random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
ts = ts.cumsum()
ts.plot()
解决案:导入matplotlib.pyplot库绘图再调用matplotlib.pyplot.show()能绘制图显示
(注:面发现知乎篇问答评论区提供):
import pandas as pd
from numpy import *
import matplotlib.pyplot as plt
ts = pd.Series(random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
ts = ts.cumsum()
ts.plot()
plt.show()
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询