3

I have a button in matplotlib, i.e.

myButton = Button(axpos, 'This is a button')

How do I make the text inside the button smaller?

Frick Steves
  • 365
  • 4
  • 11

2 Answers2

4

To change the font size of a matplotlib text, use text.set_fontsize(12). To get the text of the button, use myButton.label.

Combine the two:

myButton.label.set_fontsize(12)
ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712
1

Use this: myButton.label.set_fontsize('smaller') OR you can put in the particular size you want: myButton.label.set_fontsize(10)

Purmort
  • 11
  • 3