1

我的问题是,在绘制图形后,图形窗口冻结,我无法缩放,也无法再使用该窗口。我必须关闭它。这是我的代码:

import matplotlib.pyplot as plt
import numpy as np
abra = plt.figure()
tengely = abra.add_subplot(1, 1, 1)
x = np.linspace(0, 20, 100)
y = np.sin(x)
y2 = np.cos(x)
tengely.plot(x, y)
tengely.plot(x, y2, 'g')
plt.legend(('szinusz', 'koszinusz'), 'upper right')
tengely.set_xlabel('$x$')
tengely.set_ylabel('$\sin(x)$ és $\cos(x)$')
tengely.set_title('$\sin(x)$ és $\cos(x)$')
abra.show()

可能是什么问题?提前致谢!

4

0 回答 0