%matplotlib.pyplot的作用?
2021-01-01 本文已影响0人
是东东
经常能看到数据分析时导入三剑客之后还要在最后加一句%matplotlib.pyplot是为什么呢?
![](https://img.haomeiwen.com/i13530319/18b9749edf9bda54.png)
如果你在pycharm和spyder或者其他python的ID写上
%matplotlib.pyplot
都会报错
原因:
- 在使用jupyter notebook 或者jupyter qtconsole的时候,调用plot()函数绘画或生成一个figure画布时,可以在python conslot生成图像。