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?

2 Answers 2

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)
Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.