Multiple fontsize in same label Matplotlib

后端 未结 2 1339
忘掉有多难
忘掉有多难 2021-01-12 04:08

I\'m trying to do something relatively simple:

I want to be able to increase a font of one letter(say a LaTeX variable, say to 30) and keep the other letters in the

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-12 04:53

    One solution is to use text() and make multiple calls, carefully selecting where each letter goes:

    import pylab as plt
    a=[0,1]
    b=[0,1]
    plt.plot(a,b,'g',linewidth=3.5, label = 'a')
    plt.rc('text', usetex=True)
    plt.legend(labelspacing = 1.0,loc=1,prop={'size':40})
    
    plt.text(0.45,-0.08,'a',fontsize=50)
    plt.text(0.53,-0.08, 'N',fontsize = 20)
    

    This isn't ideal. Another option is to go through LaTeX. See other answer I'm about to post.

提交回复
热议问题