将IPython嵌入脚本并运行:
from IPython import embed
# code ...
embed()
%matplotlib
#^ With or without; same result
fig = plt.figure()
目前fig
无法执行任何操作。
已经show
n并显示窗口,
即使我从未打电话给show
。
plt.show() # does absolutely nothing
将IPython嵌入脚本并运行:
from IPython import embed
# code ...
embed()
%matplotlib
#^ With or without; same result
fig = plt.figure()
目前fig
无法执行任何操作。
已经show
n并显示窗口,
即使我从未打电话给show
。
plt.show() # does absolutely nothing
我通常以这种方式在IPython中导入matplotlib:
%matplotlib inline
import matplotlib.pyplot as plt
ax,fig = plt.subplots()
plt.plot([[1,1],[2,2]])
plt.show()
有帮助吗?