如何设置Pyplot的刻度和标签数

时间:2019-07-15 22:50:20

标签: python matplotlib

有什么方法可以将轴划分为一定数量的刻度,然后对其进行标记?例如,我有以下绘图,我想在x轴上有4个刻度,并能够自己设置标签。

enter image description here

这是我想要实现的(请注意,两个图是相同的):

enter image description here

这是我用来创建情节的脚本:

foo

我可以使用folderName来分割轴,但是我自己无法设置标签。

1 个答案:

答案 0 :(得分:0)

正如@ImportanceOfBeingErnest所述,答案是使用imshow的{​​{1}}:

extent