Conclusion of the center (graphics) in a notebook

I just upgraded to IPython 1.0 and the new laptop interface works very well. On my screen, the default width is now around 50% of the page, which improves readability. However, I often work with long timings, which I prefer to display as wide as possible.

Very wide shots will only expand to the right. Is there a way to display the output wider than the default value for expanding in the center?

The attached image shows the normal embedded graph in the first cell, which is less wide than the default width for a laptop. The second plot is wider and expands to the right. This leaves the left quarter of my screen unused.

enter image description here

+10
4

, @tooblippe, , . , , . ipython==3.1.0. , Jupyter, Jupyter.

, : css, ipython ipython:

    .output_png {
        display: table-cell;
        text-align: center;
        vertical-align: middle;
    }
+4

. , .

- . .

CSS :

from IPython.core.display import HTML
def css_styling():
    styles = open("custom.css", "r").read() #or edit path to custom.css
    return HTML(styles)
css_styling()

CSS github repo :

matplotlibrc. , . , matplotlib .

    import json
    s = json.load( open("bmh_matplotlibrc.json") )  #edit path to json file
    matplotlib.rcParams.update(s)

JSON GITHUB

+8

, . CSS :

  • Jupyter CSS ( ) ~/.jupyter/custom/custom.css :
    .output_png {
        display: table-cell;
        text-align: center;
        vertical-align: middle;
    }
    
  • , :

    from IPython.core.display import HTML
    HTML("""
    <style>
    .output_png {
        display: table-cell;
        text-align: right;
        vertical-align: middle;
    }
    </style>
    """)
    

, <style></style>.

, ( ).

+6

vertical-align:middle . , Jupyter ( , , ) .prompt . , :

.output_png {
    display: table-cell;
    text-align: center;
    margin:auto;
}
.prompt 
    display:none;
}  

, display:none .prompt in[] out[] , , . , .

+3

All Articles