Jupyter,交互式Matplotlib:隐藏交互式视图的工具栏 [英] Jupyter, Interactive Matplotlib: Hide the toolbar of the interactive view

查看:315
本文介绍了Jupyter,交互式Matplotlib:隐藏交互式视图的工具栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用Matplotlib中的交互式绘图:

I am starting using the interactive plotting from Matplotlib:

%matplotlib notebook
import matplotlib.pyplot as plt
fig, axes = plt.subplots(1, figsize=(8, 3))
plt.plot([i for i in range (10)],np.random.randint(10, size=10))     
plt.show()

任何人都知道是否可以隐藏交互模式的工具栏吗?

Anyone knows if there is a way to hide the toolbars of the interactive mode?

推荐答案

我使用一些python生成的css禁用了交互模式按钮和工具栏. 在一个笔记本单元格中运行以下命令:

I disabled the interactive mode buttons and toolbar with some python generated css. Run the following in one of the notebook cells:

%%html
<style>
.output_wrapper button.btn.btn-default,
.output_wrapper .ui-dialog-titlebar {
  display: none;
}
</style>

不幸的是,按钮上没有好的css选择器,因此我尝试使用尽可能多的特定选择器,尽管这最终可能会禁用您可能在输出单元格中生成的其他按钮. 实际上,这种方法会影响笔记本中的所有输出单元.

Unfortunately there's no good css selectors on the buttons, so I've tried to use as specific selector as possible, though this may end up disabling other buttons that you might generate in the output cell. Indeed, this approach affects all output cells in the notebook.

这篇关于Jupyter,交互式Matplotlib:隐藏交互式视图的工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆