Warning on set_matplotlib_formats
kookma opened this issue · comments
Mohammad Rahmani commented
On page 210 of book
%matplotlib inline
# settings for jupyter book: svg for html version, high-resolution png for pdf
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('svg', 'png')
import matplotlib as mpl
mpl.rcParams['figure.dpi'] = 400
returns warning! The below replacement remove the warning:
%matplotlib inline
# settings for jupyter book: svg for html version, high-resolution png for pdf
import matplotlib_inline.backend_inline
matplotlib_inline.backend_inline.set_matplotlib_formats('svg', 'png')
import matplotlib as mpl
mpl.rcParams['figure.dpi'] = 400
Hans Fangohr commented
Thank you @kookma !
I have trouble reproducing the warning you mention. Which versions of python, matplotlib and IPython do you use?
Mohammad Rahmani commented
Hi Hans
I use Python 3.9.7 with Matplotlib 3.5.1 and IPython 7.31.1
Hans Fangohr commented
I think this is resolved. Thanks for reporting it!