is it possible in matplotlib to have a textbox with different font sizes within one string?
Thanks for help
I don't think this can be done without using the LaTeX text renderer. To use this do,
from matplotlib import rcParams
rcParams['text.usetex'] = True
Then you can print multi-fontsize strings using standard LaTeX syntax, eg
from matplotlib import pyplot as plt
ax = plt.axes()
ax.text(0.5, 0.5, r'{\tiny tiny text} normal text {\Huge HUGE TEXT}')
Sometimes the LaTeX font renderer isn't ideal (eg note that tick-label fonts are different than normal MPL tick labels), but it is certainly more flexible.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.