【发布时间】:2020-04-08 02:38:29
【问题描述】:
我使用小部件后端将交互式 matplotlib 图嵌入到 ipywidgets.GridBox 中。
窗口标题占用太多空间,我想删除它。
使用plt.figure(' '),它变得不可见,但即使使用fig.tight_layout(),空间仍然被保留,并在我的布局中占用了无用的空间。
下面是一个最小的例子。
import matplotlib.pyplot as plt
%matplotlib widget
plt.ioff()
fig = plt.figure('remove the title')
plt.plot([0,1],[0,1])
fig.tight_layout()
display(fig.canvas)
我找到了一些示例here,但没有后端特定选项的完整列表。 在这篇相关文章中,给出了笔记本后端的解决方案。 what is the official name of this title bar from matplotlib, how to hide it
【问题讨论】:
标签: python matplotlib jupyter-notebook ipywidgets