【发布时间】:2019-04-25 12:31:04
【问题描述】:
我使用 seaborn 来自三列 ['Category','Installs' and 'Gross Income'] 的散点图 plot 和使用我数据集中的类别列的色调图。然而,在图例中,除了我想要显示的类别列之外,最后还有一个大自鸣得意的东西,显示了散点图中使用的列之一,Installs。我想删除这个元素,但是通过搜索其他问题和seaborn 和matplotlib 的文档,我不知道如何继续。
这是我正在使用的代码的 sn-p:
fig, ax = pyplot.subplots(figsize=(12,6))
ax=sns.scatterplot( x="Installs", y="Gross Income", data=comp_income_inst, hue='Category',
palette=sns.color_palette("cubehelix",len(comp_income_inst)),
size='Installs', sizes=(100,5000), legend='brief', ax=ax)
ax.set(xscale="log", yscale="log")
ax.set(ylabel="Average Income")
ax.set_title("Distribution showing the Earnings of Apps in Various Categories\n", fontsize=18)
plt.rcParams["axes.labelsize"] = 15
# Move the legend to an empty part of the plot
plt.legend(loc='upper left', bbox_to_anchor=(-0.2, -0.06),fancybox=True, shadow=True, ncol=5)
#plt.legend(loc='upper left')
plt.show()
【问题讨论】:
标签: python matplotlib seaborn scatter-plot