Dims
Dims

Reputation: 51039

How to avoid output into scrollable frames in jupyter notebook?

Suddenly, output for statements started to appear inside scrollable frames.

I was playing with only one parameter

pd.options.display.max_rows = 1000

but after experiments, I commented this line out and restarted the kernel.

Nevertheless, one of my outputs appears inside frame.

How to avoid this?

Upvotes: 39

Views: 41067

Answers (5)

halt9k
halt9k

Reputation: 951

From this answer:

from google.colab import output
output.no_vertical_scroll()

And it looks like a classical duplicate questions dilemma Q1 Q2, when questions are not exactly duplicates, but answers are. I'd vote for marking Q2 as dupe, adding "Alternative question: Google Colaboratory: Is there any way to expand the height of the result cell of running a code?" to Q1 in same way it was added here, and replacing my answer with source.

Upvotes: 0

Alex
Alex

Reputation: 44325

The problem might be caused by metadata in the jupyter .ipynb file. In my case the cell content looks like

{
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "plot_timecourse(time, v_soma)"
   ]
  },

By just removing the scroll part, i.e. by removing the metadata:

{
   "cell_type": "code",
   "execution_count": null,
   "metadata": {}
   "outputs": [],
   "source": [
    "plot_timecourse(time, v_soma)"
   ]
  },

fixed the issue of the weird scroll box.

Upvotes: 0

Bharat
Bharat

Reputation: 651

You can just use mouse to click on the outside of the output Frame to toggle between scrolling, it worked for me. More precisely, you have to click the square to the left of your output (see image). Where to click exactly

Single click will toggle scroll mode, double click will hide output completely.

Upvotes: 65

Vaibhav Chobisa
Vaibhav Chobisa

Reputation: 141

I stumbled across the same problem, a scrollbar appeared for outputs out of nowhere.

Just go to- Cell > All Outputs > Toggle Scrolling (On the Menu Bar) and outputs will go back to no scrolling.

Upvotes: 14

mtd
mtd

Reputation: 2364

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 a jupyter notebook extension, autoscroll, you can use for a nicer UI.

Upvotes: 49

Related Questions