plot
我使用seaborn
三列进行了分散['Category','Installs' and 'Gross Income']
,并使用数据集中的类别列进行了色调图。然而,在图例中,除了我想要出现的类别列之外,最后还有一个大自以为是的内容,显示了散点图中使用的列之一,安装。我想删除这个元素,但是通过搜索其他问题和文档seaborn
,matplotlib
我不知道如何继续。
这是我正在使用的代码片段:
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()
Run Code Online (Sandbox Code Playgroud)