Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable iPython Notebook Autoscrolling

In iPython Notebook, is it possible to disable the autoscrolling of long outputs? Or at least set a threshold for the output length before autoscrolling sets in?

Tried the following command

%%javascript IPython.OutputArea.auto_scroll_threshold = 9999; 

but it gives an error

Javascript error adding output! SyntaxError: Unexpected identifier See your browser Javascript console for more details. 
like image 471
Nyxynyx Avatar asked Apr 21 '16 00:04

Nyxynyx


People also ask

How do you get the scrollbar in Jupyter notebook?

You can try Cell -> Current Outputs -> Toggle Scrolling in the Jupyter UI to enable the scrolling for the output of one cell.


2 Answers

Can also be done via user interface.

  • Individual cells: Cell->Current Outputs->Toggle Scrolling
  • All cells: Cell->All Outputs->Toggle Scrolling

enter image description here

like image 55
ayorgo Avatar answered Oct 16 '22 22:10

ayorgo


To disable auto-scrolling, execute this javascript in a notebook cell before other cells are executed:

%%javascript IPython.OutputArea.prototype._should_scroll = function(lines) {     return false; } 

There is also an ipython notebook extension, disable_autoscroll, you can use for a more permanent change. Follow ipython issue #2172 for the latest details.

like image 40
mtd Avatar answered Oct 17 '22 00:10

mtd