问题
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?
回答1:
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.
回答2:
You can toggle the scroll window in the main menu of the notebook
Cell -> Current Outputs -> Toggle Scrolling
回答3:
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;
回答4:
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.
回答5:
I just placed my cursor in the grey box next to the output and clicked and then all of the output was displayed.
回答6:
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>"))
回答7:
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>
来源:https://stackoverflow.com/questions/18770504/resize-ipython-notebook-output-window