3

For plotting using matplotlib, how can I make fontsize smaller than xx-small of matplotlib? Thank you very much.

Ref: http://matplotlib.org/users/text_props.html

1 Answer 1

4

As the documentation states, you can also set the fontsize in points. So if you set it to 4pt it is smaller than 'xx-small'.

Example:

import matplotlib.pyplot as plt

sizes = [10,8,6,4,'xx-small']

for n,s in enumerate(sizes):
    plt.text(0,n,str(s), fontsize=s)

plt.xlim([-0.5, 0.5])
plt.ylim([-1, len(sizes)])
plt.show()

Result: enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

But then the fontsize will not be relative but absolute ...

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.