Open lusu2004 opened 5 years ago
Yes I can confirm this. However, the same lines of code are working fine in vanilla ipython. In ptipython both magic function %pylab and %matplotlib cause the same error
%pylab # Figure is blank
%matplotlib # Figure is blank
Working! with show(block=True)
Following the plt.plot command with
%pylab
x = np.linspace(0,6,1000)
y= np.sin(x)
plt.plot(x,y)
show(block=True)
plot figure is rendered as expected.
Using matplotlib directly without the magic functions, works!
import matplotlib
matplotlib.use('Qt5Agg',warn=False, force=True)
from matplotlib import pyplot as plt
plt.plot([1,2,3],[1,2,3])
plt.show()
The issue seems to be related to non-blocking show command under ptipython. Figure shows nothing with the following:
import matplotlib
matplotlib.use('Qt5Agg',warn=False, force=True)
from matplotlib import pyplot as plt
plt.plot([1,2,3],[1,2,3])
plt.show(block=False)
This seems to be an old issue. Please refer to issues #20 #221
From a cursory reading its looks like the issue is with the event loops for ptipthon and ipython.
the Figure1 window rised, but show nothing.
Thanks