I just upgraded to IPython 1.0 and the new notebook interface performs really well. On my screen it now has a default width of about 50% of the page which improves readability. However, i often work with long timeseries which i prefer to display as wide as possible.
Very wide pictures will only extend further to the right. Is there a way to display output wider then the default to expand in a centered matter?
The attached picture shows a normal inline plot in the first cell, which is less wide then the default notebook width. The second plot is wider and expands to the right. This leaves about the left quarter of my screen unused.
The answer given by @tooblippe, although changes the style of the notebook, does not address the question. However, using the first part of that solution, you would be able to achieve the centering of the plots. This solution works for
ipython==3.1.0
. For higher versions that include Jupyter, you would want to edit the styling ofJupyter
instead.So, the solution would be: You can either modify the above css file or add this line to the styling of your ipython environment in the ipython folder:
What I do is the following. This might help, but it also creates a beautifully rendered notebook.
Have a look at this online book about Bayesian Statistics. This is really nice.
They load a custom CSS at the end of the notebook using this code:
You can download this custom CSS from the books github repo HERE: Drop it in the notebook folder and call the code above
Also note their nice matplotlibrc file. You can change the look and feel of the plots calling this code. Call this early in the notebook and all matplotlib plots will look pretty cool.
Download the JSON file HERE from GITHUB
In short you have two options. Both add CSS styling to the notebook to achieve the effect:
~/.jupyter/custom/custom.css
and add:Modify the style of the current notebook by executing a code cell with:
Note that in the first case there is no
<style></style>
.I prefer the second option, specially if I'm going to share the notebook (since its self-contained).
vertical-align:middle
did not work for me. Also, in the latest Jupyter (maybe others, but at least) there is a class called.prompt
that takes up space only on the left of the page. I was able to work around both using this:Just know that setting
display:none
on.prompt
will cause all of thein[]
andout[]
displays to disappear and know that's what you want if you're going to do it. Hope that was helpful.