Seaborn plots not showing up

前端 未结 7 1525
暖寄归人
暖寄归人 2020-11-27 09:54

I\'m sure I\'m forgetting something very simple, but I cannot get certain plots to work with Seaborn.

If I do:

import seaborn as sns
7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 10:31

    If you plot in IPython console (where you can't use %matplotlib inline) instead of Jupyter notebook, and don't want to run plt.show() repeatedly, you can start IPython console with ipython --pylab:

    $ ipython --pylab     
    Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) 
    Type 'copyright', 'credits' or 'license' for more information
    IPython 7.0.1 -- An enhanced Interactive Python. Type '?' for help.
    Using matplotlib backend: Qt5Agg
    
    In [1]: import seaborn as sns
    
    In [2]: tips = sns.load_dataset("tips")
    
    In [3]: sns.relplot(x="total_bill", y="tip", data=tips) # you can see the plot now
    

提交回复
热议问题