避免重叠注释

问题描述

我在下面有一个注释散点的代码

        for x,y in zip(xs,ys):

            label = "{:.2f}%".format(y)

            plt.annotate(label,# this is the text
                         (x,y),# this is the point to label
                         textcoords="offset points",# how to position the text
                         xytext=(0,10),# distance from text to points (x,y)
                         ha='center') # horizontal alignment can be left,right or center
        

我的结果图是这样的:我有很多点靠得太近,使注释重叠。 有谁知道根据我当前的代码如何避免它?

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)