jupyter notebook inline plots as svg

前端 未结 2 1323
醉话见心
醉话见心 2020-12-13 02:56

By default jupyter notebook inline plots are displayed as png, e.g.:

import matplotlib.pyplot as plt
%matplotlib inline
plt.plot()

How can

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 02:58

    Use set_matplotlib_formats('svg').

    import matplotlib.pyplot as plt
    from IPython.display import set_matplotlib_formats
    %matplotlib inline
    set_matplotlib_formats('svg')
    plt.plot()
    

    This is also documented in a document of %matplotlib magic.

    Note: InlineBackend.figure_format is deprecated.

提交回复
热议问题