如何通过 python 中的 drawparallels 将标签字体设置为 "Time New Roman"

How to set the label Fonts as "Time New Roman" by drawparallels in python

我画了一张标有纬度的地图,但我想将字体设置为 "Times New Roman"。如何让它成为可能?

m.drawparallels(平行线,标签=[1,0,0,0],字体大小=12)

您需要使用 matplotlibpyplot 设置字体系列。

import matplotlib.pyplot as plt
csfont = {'fontname':'Times New Roman'}
// write your code related to basemap here
plt.title('title',**csfont)
plt.show()

您还可以使用以下方法全局更改字体。

import matplotlib.pyplot as plt
plt.rcParams["font.family"] = "Times New Roman"