prevent plot from showing in jupyter notebook

后端 未结 6 2195
梦毁少年i
梦毁少年i 2020-12-04 23:19

How can I prevent a specific plot to be shown in Jupyter notebook? I have several plots in a notebook but I want a subset of them to be saved to a file and not shown on the

6条回答
  •  忘掉有多难
    2020-12-04 23:54

    From IPython 6.0 on, there is another option to turn the inline output off (temporarily or persistently). This has been introduced in this pull request.

    You would use the "agg" backend to not show any inline output.

    %matplotlib agg
    

    It seems though that if you had activated the inline backend first, this needs to be called twice to take effect.

    %matplotlib agg
    %matplotlib agg
    

    Here is how it would look in action

提交回复
热议问题