Matplotlib: changing font size of exponent

前端 未结 1 1140
清酒与你
清酒与你 2020-12-10 22:06

I want to change the fontsize of the exponent as marked on the picture \"pic\" I cannot use the matplotlib.rc(

相关标签:
1条回答
  • 2020-12-10 22:10

    If the exponent is an offset computed by matplotlib you can do the following to change the font size of the exponent to 30

    import matplotlib.pyplot as plt
    import numpy as np
    
    x = np.linspace(1,1.0001,100)
    
    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.plot(x)
    t = ax.yaxis.get_offset_text()
    t.set_size(30)
    plt.show()
    
    0 讨论(0)
提交回复
热议问题