Matplotlib中%matplotlib inline是什么、如何使用?

​ Python绘图问题:Matplotlib中%matplotlib inline是什么、如何使用?

答:Python绘图问题:Matplotlib中%matplotlib inline是什么、如何使用?_LthID的博客-CSDN博客_def plotbarcharts(inpdata, colstoplot): %matplotli

%matplotlib inline是什么意思__洋_的博客-CSDN博客_%matplotlib inline什么意思

注意:既然是IPython的内置magic函数,那么在Pycharm中是不会支持的。但是我们可以在matplotlib中的pyplot身上下功夫,pyplot不会不提供展示图像的功能。可以像下面这样写:

import numpy as np

from matplotlib import pyplot as plt

 

from skimage import data

 

random_image = np.random.random([500, 500])

print(random_image)

plt.imshow(random_image, cmap='gray')

plt.colorbar()

plt.show()

Matplotlib图表不能在Pycharm中显示的问题_xinluqishi_fangye的博客-CSDN博客_pycharm用不了matplotlib

你可能感兴趣的:(学习,pycharm)