ejs*_*in1 5 python scatter matplotlib pandas
我想绘制一个带有标签的散点图。但是,这些标签是重叠的。如何增强外观,以便更好地查看数字?另外,我的数字是整数,但它以浮点数显示标签值。我想知道为什么。
期待收到您的回音。
这是我的代码:
col = df['type'].map({'a':'r', 'b':'b', 'c':'y'})
ax = df.plot.scatter(x='x', y='y', c=col)
df[['x','y','id']].apply(lambda x: ax.text(*x),axis=1)
Run Code Online (Sandbox Code Playgroud)