How to make a large figure in a cell of a Jupyter laptop, scrollable when it is displayed in html

As you know, when you print a large table in a Jupyter Notebook cell, it automatically scrolls horizontally or vertically when it is too large if the table is printed in a laptop environment or saved in an html file.

But for a figure, when it is too large, it becomes scrollable like a large table, but only when it is printed in a laptop environment. When it is saved in an html file, the whole picture is placed in a smaller area and, therefore, it is very difficult to read the axes.

How can i do this?

For example, in a Notebook, if you click the left and bottom border of a shape, you will get scroll bars on the right and bottom.

enter image description here

"", html , :

enter image description here

+6
1

.

CSS

, CSS, .

from IPython.core.display import HTML
style = """
<style>
div.output_area {
    overflow-y: scroll;
}
div.output_area img {
    max-width: unset;
}
</style>
"""
HTML(style) 

, .

, custom/custom.css jupyter ( ). , config ,

import jupyter_core;jupyter_core.paths.jupyter_config_dir()

.

nbconvert

, HTML, nbconvert . , , , , .

0

Source: https://habr.com/ru/post/1681872/


All Articles