如何在Jupyter Notebooks/Lab中抑制单个单元的matplotlib内联? [英] How to suppress matplotlib inline for a single cell in Jupyter Notebooks/Lab?

查看:70
本文介绍了如何在Jupyter Notebooks/Lab中抑制单个单元的matplotlib内联?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在查看 matplotlib python inline on/off ,这种解决方法问题,但是当我执行plt.ion()时,所有图都弹出(上百个图).我想将它们抑制在一个单元格中.是否可以使用with循环关闭%matplotlib inline或这是不可能的?

I was looking at matplotlib python inline on/off and this kind of solves the problem but when I do plt.ion() all of the Figures pop up (100s of figures). I want to keep them suppressed in a single cell. Is there a with loop I can use to turn off %matplotlib inline or is this impossible?

推荐答案

在单元格末端之前关闭的数字将不会显示.在单元格末尾调用plt.close("all")将关闭所有数字,并且单元格的输出中将不显示任何数字.

Figures closed before the end of the cell will not be shown. Calling plt.close("all") at the end of the cell will close all figures and none will be displayed in the cell's output.

这篇关于如何在Jupyter Notebooks/Lab中抑制单个单元的matplotlib内联?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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