%matplotlib笔记本在Jupyter笔记本中显示空白图标

问题描述 投票:0回答:1

我正在尝试使用Jupyter中的滑块和matplotlib创建一个简单的交互式绘图,但是,图标只是显示一个空白方块而不是?如下图:

Blank icons using notebook backend

我错过了依赖吗?我相信我正在使用默认设置。

我的代码的简化版本如下所示:

%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)

提前致谢!

python matplotlib jupyter-notebook
1个回答
0
投票

当超过特定大小时,Jupyter Notebook会将重型图表和表格最小化。不确定准确的答案,但你是否尝试双击图表的左边缘?它在我的Windows PC中完成了这项工作。

© www.soinside.com 2019 - 2024. All rights reserved.