简体   繁体   English

如何在Jupyter Notebook中获得较大的输出窗口?

[英]How to get the large output window in jupyter notebook?

When we have a large output in jupyter notebook it automatically creates scrollable output window. 当jupyter笔记本中有大量输出时,它将自动创建可滚动的输出窗口。 Is there a way we can choose width and height of window so that all of the output plots are shown in jupyter notebook? 有没有一种方法可以选择窗口的宽度和高度,以使所有输出图都显示在jupyter笔记本中?

For example: 例如:

import matplotlib.pyplot as plt
%matplotlib inline


for i in range(10):
    plt.plot(range(10))
    plt.show()

Creates a window like this: 创建一个这样的窗口: 在此处输入图片说明

Can we see all the plots without scrolling? 我们可以不滚动而查看所有图吗?

I am aware of autoscroll nbextension, but wanted to get a large output window here. 我知道自动滚动nbextension,但想在这里获得较大的输出窗口。

Also, for pandas there are commands like pd.options.display.max_rows . 另外,对于熊猫来说,有类似pd.options.display.max_rows命令。 How to do this for output windows? 如何针对输出窗口执行此操作?

Thanks to @Abdou, I just found the answer in this link resize ipython notebook output window . 多亏@Abdou,我才在此链接中调整ipython Notebook输出窗口的大小找到了答案。

The original answer is by @keflavich. 原始答案是@keflavich。

I am keeping this question just for the reference purpose. 我保留这个问题仅供参考。 It will be closed soon. 它将很快关闭。

%%javascript
IPython.OutputArea.auto_scroll_threshold = 9999;

# another cell
import matplotlib.pyplot as plt
%matplotlib inline


for i in range(10):
    plt.plot(range(10))
    plt.show()

Now the output window will be large and we can see all the outputs without scrolling. 现在输出窗口将很大,我们无需滚动即可看到所有输出。

Date: Sep 26, 2018 日期:2018年9月26日
Browser: Safari 10.1.2 浏览器:Safari 10.1.2
Platform: OSX Yosemite 10.10 平台:OSX Yosemite 10.10

在此处输入图片说明

In case somebody wants to resize the height of the scrollable output instead of removing the scroll feature: 如果有人想调整可滚动输出的高度而不是删除滚动功能:

from IPython.core.display import display, HTML
display(HTML("<style>div.output_scroll { height: 44em; }</style>"))

44em is just an example 44em只是一个例子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM