resize ipython notebook output window

百般思念 提交于 2019-11-29 21:59:30
Matt

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.

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

Cell -> Current Outputs -> Toggle Scrolling

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;

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.

Taylor Somma

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

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>"))

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!