【发布时间】:2017-06-08 13:27:05
【问题描述】:
我在 matplotlib 中有一个按钮,即
myButton = Button(axpos, 'This is a button')
如何让按钮内的文字变小?
【问题讨论】:
标签: python matplotlib matplotlib-widget
我在 matplotlib 中有一个按钮,即
myButton = Button(axpos, 'This is a button')
如何让按钮内的文字变小?
【问题讨论】:
标签: python matplotlib matplotlib-widget
要更改 matplotlib 文本的字体大小,请使用 text.set_fontsize(12)。
要获取按钮的文本,请使用myButton.label。
将两者结合起来:
myButton.label.set_fontsize(12)
【讨论】:
使用这个:myButton.label.set_fontsize('smaller') 或者你可以输入你想要的特定尺寸:myButton.label.set_fontsize(10)
【讨论】: