Python 如何删除matplotlib批注并调整其大小?
我正在使用basicPython 如何删除matplotlib批注并调整其大小?,python,matplotlib,Python,Matplotlib,我正在使用basicaxis.annotate(str(I))函数沿图形的点显示值。问题是他们很快就聚在一起了。所以我有两个问题:如何删除注释?我怎样才能使一个更小(字体大小) 以下是对注释方法的参考: 我做了研究,却意外地什么也没发现。干杯。axis.annotate(str(i))返回axes注释对象。您需要为其分配一个变量,然后根据需要对其进行操作 fig, ax = plt.subplots(1,1) ax.plot(range(5)) text = ax.annotate(xy =
axis.annotate(str(I))
函数沿图形的点显示值。问题是他们很快就聚在一起了。所以我有两个问题:如何删除注释?我怎样才能使一个更小(字体大小)
以下是对注释方法的参考:
我做了研究,却意外地什么也没发现。干杯。axis.annotate(str(i))返回axes注释对象。您需要为其分配一个变量,然后根据需要对其进行操作
fig, ax = plt.subplots(1,1)
ax.plot(range(5))
text = ax.annotate(xy = (2,2), s='asdf')
# use any set_ function to change all the properties
text.set_fontsize(20)
axis.annotate(str(i))
返回axis注释对象。您需要为其分配一个变量,然后根据需要对其进行操作
fig, ax = plt.subplots(1,1)
ax.plot(range(5))
text = ax.annotate(xy = (2,2), s='asdf')
# use any set_ function to change all the properties
text.set_fontsize(20)
聚束注释的问题已经解决了,可能同样令人感兴趣。看起来很有趣。干杯。聚束注释的问题已经解决,可能同样令人感兴趣。看起来很有趣。干杯。您可以使用
del
从人物中删除任何艺术家。因此,在这种情况下,del text
将起作用。您可以使用del
从图形中删除任何艺术家。因此在这种情况下,deltext
将起作用。