Ответ 1
%config InlineBackend.figure_format = 'svg'
делает трюк. Минимальный пример:
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = 'svg'
plt.plot()
По умолчанию графические строки jupyter для ноутбуков отображаются как png, например:
import matplotlib.pyplot as plt
%matplotlib inline
plt.plot()
Как вы можете настроить jupyter notebooks для отображения графических строк matplotlib как svg?
%config InlineBackend.figure_format = 'svg'
делает трюк. Минимальный пример:
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = 'svg'
plt.plot()
Используйте set_matplotlib_formats('svg')
.
import matplotlib.pyplot as plt
from IPython.display import set_matplotlib_formats
%matplotlib inline
set_matplotlib_formats('svg')
plt.plot()
Это также задокументировано в документе% matplotlib magic.
Примечание. InlineBackend.figure_format
устарело.