29

我有一个图,我将子图添加到(插图)。我用过:

fig = plt.figure()
ax = fig.add_subplot(111)
subA = fig.add_axes([0.4,0.14,0.2,0.2])

我现在想更改子图的xtick字体大小。我尝试了一些天真的方法,例如

subA.get_xaxis().get_xticks().set_fontsize(10)

没有任何运气。

那我该怎么做呢?

4

2 回答 2

46

利用:

subA.tick_params(labelsize=6)
于 2015-09-03T00:14:51.973 回答
24
fig = plt.figure()
ax = fig.add_subplot(111)
plt.xticks([0.4,0.14,0.2,0.2], fontsize = 50) # work on current fig
plt.show()

x/yticks 与matplotlib.text具有相同的属性

于 2012-10-30T14:29:36.650 回答