How to make inline plots in Jupyter Notebook larger? How to make inline plots in Jupyter Notebook larger? python python

How to make inline plots in Jupyter Notebook larger?


The default figure size (in inches) is controlled by

matplotlib.rcParams['figure.figsize'] = [width, height]

For example:

import matplotlib.pyplot as pltplt.rcParams['figure.figsize'] = [10, 5]

creates a figure with 10 (width) x 5 (height) inches


Yes, play with figuresize and dpi like so (before you call your subplot):

fig=plt.figure(figsize=(12,8), dpi= 100, facecolor='w', edgecolor='k')

As @tacaswell and @Hagne pointed out, you can also change the defaults if it's not a one-off:

plt.rcParams['figure.figsize'] = [12, 8]plt.rcParams['figure.dpi'] = 100 # 200 e.g. is really fine, but slower


I have found that %matplotlib notebook works better for me than inline with Jupyter notebooks.

Note that you may need to restart the kernel if you were using %matplotlib inline before.

Update 2019:If you are running Jupyter Lab you might want to use%matplotlib widget


matomo