5

When we have a large output in jupyter notebook it automatically creates scrollable output window. Is there a way we can choose width and height of window so that all of the output plots are shown in jupyter notebook?

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: enter image description here

Can we see all the plots without scrolling?

I am aware of autoscroll nbextension, but wanted to get a large output window here.

Also, for pandas there are commands like pd.options.display.max_rows. How to do this for output windows?

2 Answers2

10

Thanks to @Abdou, I just found the answer in this link resize ipython notebook output window.

The original answer is by @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
Browser: Safari 10.1.2
Platform: OSX Yosemite 10.10

enter image description here

7

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

aless80
  • 3,122
  • 3
  • 34
  • 53
  • Can you clarify how to use this code? I copied/pasted in a cell, ran the command, but it didn't work for me. – Huy Truong Feb 08 '22 at 06:17
  • @HuyTruong What kind of "didn't work for me" did you get? Can you share the Error message or describe the problematic behaviour otherwise? – NerdOnTour Feb 15 '22 at 12:51