【发布时间】:2018-04-24 15:03:58
【问题描述】:
以下脚本生成带有注释数据点的散点图。我想从图中删除圆形标记并只显示标签。
fig, ax = Plot.subplots()
ax.scatter(Y0_mean, Y1_mean)
for i, txt in enumerate(features.playerCountry.unique()):
country_name = countries_code[countries_code.CountryCode == txt]
['ctr'].values[0].lower()
ax.annotate(country_name, (Y0_mean[i], Y1_mean[i]), xytext=(Y0_mean[i],
Y1_mean[i]), size=5)
ax.legend(fontsize=8)
fig.savefig(figPath + 'LocationAwareMeanFeatures_ctr'+str(lr), dpi=300)
【问题讨论】:
-
不要打电话给
ax.scatter?或者,如果您确实想在调用ax.scatter后删除一个点,请参阅下面的副本 -
@DavidG 当我删除
ax.scatter()时不会显示任何内容。我还尝试了ax.remove()显示空白情节。
标签: python matplotlib annotate