Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/354.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 没有正确地显示情节_Python_Pycharm - Fatal编程技术网

Python 没有正确地显示情节

Python 没有正确地显示情节,python,pycharm,Python,Pycharm,我这里有一个测试图,我想用pycharm显示 import numpy as np import matplotlib.pyplot as plt # Come up with x and y x = np.arange(0, 5, 0.1) y = np.sin(x) # Just print x and y for fun print(x) print(y) # Plot the x and y and you are supposed to see a sine curve plt.

我这里有一个测试图,我想用pycharm显示

import numpy as np
import matplotlib.pyplot as plt

# Come up with x and y
x = np.arange(0, 5, 0.1)
y = np.sin(x)

# Just print x and y for fun
print(x)
print(y)

# Plot the x and y and you are supposed to see a sine curve
plt.plot(x, y)

# Without the line below, the figure won't show
plt.interactive(False)
plt.show()
为了便于阅读,我添加了一些注释

但是,当我运行脚本时,pycharm中的
SciView
窗口中没有显示任何内容。为什么会这样?我查看了其他资源,设置了
plt.interactive(False)
可能会有帮助,但我尝试了这两个选项,但运气都不好,有人能帮忙吗


目前存在类似问题。您可以添加您使用的Pycharm版本吗?您是在控制台中手动执行代码还是运行脚本?
matplotlib.get\u backend()
返回什么?