Matplotlib: Times New Roman appears bold

后端 未结 8 1732
醉梦人生
醉梦人生 2021-02-14 23:40

For some reason when using Times New Roman in my mpl plots it appears bold. Other fonts are OK.

Here is a minimal example, and the result (inside a Word doc

8条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-15 00:15

    As stated above the default font weighting is high for Times New Roman font in mpl (claim was 500 above, which I will take their word for it).

    The easy fix for this is to set the weighting yourself using fontweight.

    plt.xlabel('t',fontsize=32, fontname = 'Times New Roman', fontweight = 250)
    

    This worked for me and looked normal.

提交回复
热议问题