If I plot a graph or display a table in Jupyter Notebook the figures are really small and unreadable. What is the best way to set the figure size settings globally in Jupyter Notebook? For comparison in Quantopian's Notebook version plots and tables are a lot larger. I know there are separate settings for matplotlib and other libraries but I would like to set global settings. I also tried this setting, but it didn't work.
%config InlineBackend.figure_format='retina'
If "globally" means for all successive outputs in a given notebook, I use
plt.rcParams['figure.figsize'] = (16,8)
after importing matplotlib. This affect all subsequent plots. If you wish a single configuration for all notebooks, the reply by Louise Davies is more appropriate.
I'm pretty sure there's no "global setting" for all packages in jupyter. The best you can do is configure the defaults for matplotlib
and pandas
etc. Note that other graphing libraries have larger default outputs (from the top of my head I know plotly
has full width graphs by default)
To configure global python settings, run ipython profile create
to create a ~/.ipython/profile_default/ipython_kernel_config.py
file, and add the line:
c.InlineBackend.rc = { 'figure.figsize': (20.0, 10.0) }
See https://matplotlib.org/users/customizing.html for more info on customising matplotlib
As for pandas, I don't think it has global options for style. You could add stuff to jupyter's custom.css file (`~/.jupyter/custom/custom.css) like so:
.dataframe {
font-size: 14px !important;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With