import matplotlib.pyplot as plt
%matplotlib inline
fig=plt.figure()
plt.show()
Output is:
matplotlib.figure.Figure at 0x536ea70
I want to see empty plot and i was going through a pycon tutorial the same code produced a empty plot.
import matplotlib.pyplot as plt
%matplotlib inline
fig=plt.figure()
plt.show()
Output is:
matplotlib.figure.Figure at 0x536ea70
I want to see empty plot and i was going through a pycon tutorial the same code produced a empty plot.
IPython will not generate any output for figures that do not contain an axes.
If you add an axes to your figure, the figure will show fine.
%matplotlib inline
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
plt.show()
or
%matplotlib inline
import matplotlib.pyplot as plt
plt.gca()
plt.show()
If you then remove the axes, it will again show the returned python string again.
The solution to show a completely empty figure with the inline backend is hence to add an axes but then turn it invisible.
%matplotlib inline
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.set_visible(False)
plt.show()