153

By default the ipython notebook ouput is limited to a small sub window at the bottom. This makes us force to use separate scroll bar that comes with the output window, when the output is big.

Any configuration option to make it not limited in size, instead run as high as the actual output is? Or option to resize it once it gets created?

broccoli2000
  • 1,753
  • 1
  • 17
  • 15
nom-mon-ir
  • 3,748
  • 8
  • 26
  • 42

11 Answers11

309

You can toggle the scroll window in the main menu of the notebook

Cell -> Current Outputs -> Toggle Scrolling

Jacob Stevenson
  • 3,718
  • 1
  • 13
  • 10
46

Addendum #2: This comment: https://github.com/ipython/ipython/issues/2172#issuecomment-53708976 indicates how you can increase the maximum size of the output cells. Run the following code in the notebook:

%%javascript
IPython.OutputArea.auto_scroll_threshold = 9999;
keflavich
  • 18,278
  • 20
  • 86
  • 118
  • Doesn't seem to work. In the console I get: `accessing OutputArea is deprecated. Use require("notebook/js/outputarea").OutputArea`. Putting that in the console shows it be a function. – broccoli2000 Jul 04 '16 at 18:41
  • Didn't work for me, possibly because my output is Javascript-generated. – Sergey Orshanskiy Jul 11 '16 at 17:50
  • 2
    does't work. the output afte executing a cell is still in a scrollable area. In my case, suddenly, ipython notebook switches to scrollable panes for certain outputs, while they uses to be "normal" on beforehand. Very enigmatic... – user989762 Jul 28 '16 at 06:54
  • Javascript error adding output! SyntaxError: Invalid or unexpected token See your browser Javascript console for more details. – Laurent T Mar 30 '22 at 12:35
38

I just placed my cursor in the grey box next to the output and clicked and then all of the output was displayed.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Taylor Somma
  • 389
  • 3
  • 2
31

To resize the height of the scrollable output I do the following (you can change 44em):

from IPython.core.display import display, HTML
display(HTML("<style>div.output_scroll { height: 44em; }</style>"))
aless80
  • 3,122
  • 3
  • 34
  • 53
17

This worked for me in Chrome. Run it in a separate cell. Choose the max-height you want to display without scrolling.

%%html
<style>
.output_wrapper, .output {
    height:auto !important;
    max-height:1000px;  /* your desired max-height here */
}
.output_scroll {
    box-shadow:none !important;
    webkit-box-shadow:none !important;
}
</style>

You'll still get scroll bars if the contents exceed the max-height. There won't be a shadow box, though. Just increase the max-height even more if really don't want scrolling at all.

broccoli2000
  • 1,753
  • 1
  • 17
  • 15
9

See the jupyter autoscroll extension (part of jupyter_contrib_nbextensions), which allows you to select when the output starts scrolling in a dropdown menu (you can set it to never scroll). The API used is not officially supported though, so this may break at any time.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Matt
  • 27,170
  • 6
  • 80
  • 74
  • Thanks Matt! How do I use it? – nom-mon-ir Sep 13 '13 at 14:56
  • 1
    clone repo in the right place in your ipython profile. (cf readme) copy custom.example.js to custom.js and uncomment require('custom/autoscroll.js') in it. Restart IPython. – Matt Sep 14 '13 at 09:24
2

For an plot.ly iplot I had to add the following to see any change (it changed all output)

%%html
<style>
.python-iframe > iframe {
  height:1000px !important;
}
</style>
Cireo
  • 4,197
  • 1
  • 19
  • 24
2

This is what works for me:

%%html
<style>
.output_wrapper .output {
  overflow-y: visible;
  height: fit-content;
}
</style>

It may depend on the version of Jupyter.

Jose Solorzano
  • 393
  • 4
  • 6
1

I tried all the options above and none of them worked. This is how I got rid of the scrolling cell. Right-click on the cell, and click "disable scrolling for outputs" I know this doesn't resize the scrolling cell, but it does make my code more legible since the scrolling cells are very small(for me at least).

Chris
  • 27
  • 1
  • 3
0

To disable scrolling for outputs in JupyterLab, simply follow these steps:

  1. Right-click on the output area in JupyterLab to display the output menu.
  2. From the output menu, select "Disable Scrolling for Outputs".

That's it! Your output should now be displayed without scrolling.

Adrien C
  • 1
  • 2
-2

In JupyterLab you can right click and choose: Create New View for Output.

baz
  • 1,317
  • 15
  • 10