简体   繁体   中英

%matplotlib notebook shows blank icons in Jupyter notebook

I'm trying to create a simple interactive plot with sliders and matplotlib in Jupyter, however, the icons are simply showing a blank square instead? Figure below:

Blank icons using notebook backend

Am I missing a dependency? I believe I'm using default settings for everything.

A simplified version of my code is shown below:

%matplotlib notebook
import matplotlib.pyplot as plt
from ipywidgets import FloatSlider, interact

fig = plt.figure(figsize=(10,3))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlabel('time [s]')
ax.set_ylabel('displacement [cm]')
x1, = ax.plot(t,x)

def update(P_l = FloatSlider(min=0,max=4000,step=50,value=1500)):
    x1.set_ydata(x)

    fig.canvas.draw()

interact(update)

Thanks in advance!

Jupyter Notebook tends to minimize heavy graphs and tables when it exceeds a specific size. Not sure about the accurate answer, But did you try double clicking the left edge of graph? It does the job in my windows PC.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM