如何在使用小部件后端时删除matplotlib图形的窗口标题

2024-05-29 03:06:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用小部件后端将交互式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


Tags: the图形标题titlematplotlib部件fig空间

热门问题