How to change fonts in matplotlib (python)?

后端 未结 5 1140
不思量自难忘°
不思量自难忘° 2020-11-29 20:26

It sounds as an easy problem but I do not find any effective solution to change the font (not the font size) in a plot made with matplotlib in python.

I found a coup

5条回答
  •  臣服心动
    2020-11-29 20:32

    You can also use rcParams to change the font family globally.

     import matplotlib.pyplot as plt
     plt.rcParams["font.family"] = "cursive"
     # This will change to your computer's default cursive font
    

    The list of matplotlib's font family arguments is here.

提交回复
热议问题