From 1c5d748857a02d000b7e6dfcd66d321937898147 2016-03-06 12:48:08 From: Min RK Date: 2016-03-06 12:48:08 Subject: [PATCH] Backport PR #9299: FIX: account for dpi == 'figure' In mpl 1.5.0 'figure' became a valid dpi value, in 2.0 it will become the default. xref https://github.com/matplotlib/matplotlib/issues/6113 ... --- diff --git a/IPython/core/pylabtools.py b/IPython/core/pylabtools.py index 687486c..136f39e 100644 --- a/IPython/core/pylabtools.py +++ b/IPython/core/pylabtools.py @@ -98,6 +98,8 @@ def print_figure(fig, fmt='png', bbox_inches='tight', **kwargs): return dpi = rcParams['savefig.dpi'] + if dpi == 'figure': + dpi = fig.dpi if fmt == 'retina': dpi = dpi * 2 fmt = 'png'