复制代码
1
2
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14import numpy as np import seaborn as sns import matplotlib.pyplot as plt np.random.seed(sum(map(ord, 'axis_grids'))) tips = sns.load_dataset('tips') tips.head() # 将FacetGrid实例化出来 g = sns.FacetGrid(tips, col='time') g.map(plt.hist, 'tip') # 散点图把数据描绘出来 alpha透明程度,越小越透明 g = sns.FacetGrid(tips, col='sex', hue='smoker') g.map(plt.scatter, 'total_bill', 'tip', alpha=.1) g.add_legend() plt.show()
在代码最后加上plt.show( )即可。
最后
以上就是爱笑时光最近收集整理的关于seaborn在pycharm中绘图不出图原因的全部内容,更多相关seaborn在pycharm中绘图不出图原因内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复