Modify tick label text

前端 未结 10 1455
遥遥无期
遥遥无期 2020-11-22 07:13

I want to make some modifications to a few selected tick labels in a plot.

For example, if I do:

label = axes.yaxis.get_major_ticks()[2].label
label         


        
10条回答
  •  误落风尘
    2020-11-22 08:06

    If you do not work with fig and ax and you want to modify all labels (e.g. for normalization) you can do this:

    labels, locations = plt.yticks()
    plt.yticks(labels, labels/max(labels))
    
    

提交回复
热议问题