解决seaborn在pycharm中绘图不出图的问题 如下所示: import 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中绘图不出图的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持中文源码网。