jupyter notebook inline plots as svg

前端 未结 2 1242
醉话见心
醉话见心 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.

    0 讨论(0)
  • 2020-12-13 02:58

    %config InlineBackend.figure_formats = ['svg'] does the trick. A minimal example is:

    %config InlineBackend.figure_formats = ['svg']
    
    import matplotlib.pyplot as plt
    %matplotlib inline
    plt.plot()
    
    0 讨论(0)
提交回复
热议问题