I am using a Jupyter Notebook to build picchart drawings.
In the first cell with my code, I have a magic command %matplotlib inline
, and after this magic command I run my code, everything works fine, and my figure displays.
But in the second cell , when I set %matplotlib notebook
for interactive charting, my figure will not be displayed after starting this second cell.
I need to restart the kernel and restart the cell using %matplotlib notebook
and not run the command %matplotlib inline
before that.
Here is my code for the first cell with %matplotlib inline
, which does a fine:
import matplotlib.pyplot as plt
%matplotlib inline
labels = "No", "Yes"
sizes = [100, 50]
fig, ax = plt.subplots(figsize=(6, 6))
_, texts, autotexts = ax.pie(sizes, explode=explode, labels=labels, colors=colors, autopct='%1.1f%%',
shadow=False, startangle=90)
ax.axis('equal')
, %matplotlib inline
%matplotlib notebook
. , .
?