在PyCharm IDE中使用jupyter,能否得到交互式绘图?如果不能,为什么?
交互式绘图是指可以缩放的窗口中的图表。
我尝试过,但Python总是会崩溃:
#%%
import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl
mpl.use('TkAgg') # or can use 'TkAgg', whatever you have/prefer 'Qt5Agg'
# Data for plotting
t = np.arange(0.0, 2.0, 0.00001)
s = 1 + np.sin(2 * np.pi * t)
fig, ax = plt.subplots()
ax.plot(t, s)
ax.set(xlabel='time (s)', ylabel='voltage (mV)',
title='About as simple as it gets, folks')
ax.grid()
plt.show()
%matplotlib inline
命令。 - PreciXon