简体   繁体   中英

Can I have two different font sizes in a matplotlib axes label?

Is is possible to have two different font sizes in one matplotlib axes label? I know I can set the font size with

fontsize = int

but what I would like to do is something like:

plt.ylabel('Text 1', fontsize1=20, 'Text 2', fontsize2=15)

is there a way in matplotlib / seaborn to do so?

Thanks

One thing you can do is using LaTeX in order to get different sizes in the same string:

plt.rc('text', usetex=True)
plt.ylabel(r'\small{Text 1} \Huge{Text2}')

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM