如何更改pyplot上的yticks?

时间:2015-09-18 15:14:07

标签: python matplotlib

我在pyplot上有两个箱图,我想要更改' 1'和' 2'两个叮叮&的后期索引'和' Pre Index'。怎么会这样做?

{{1}}

1 个答案:

答案 0 :(得分:1)

您只需要设置当前轴的yticklabelsgca()获取当前轴)

plt.gca().set_yticklabels(['Post Index', 'Pre Index'])

enter image description here