I have draw a map with latitudes labelled but I want to set the fonts as "Times New Roman". How to make it possible?
m.drawparallels(parallels,labels=[1,0,0,0],fontsize=12)
Tkinter Label Widgets are used to create labels in a window. We can style the widgets using the tkinter. ttk package. In order to resize the font-size, font-family and font-style of Label widgets, we can use the inbuilt property of font('font-family font style', font-size).
In Matplotlib, to set the title of a plot you have to use the title() method and pass the fontsize argument to change its font size. The above-used parameters are described as below: label: specifies the title. fontsize: set the font size of your choice.
Create a figure and a set of subplots. Plot x data points using plot() method. To change the font size of the scale in matplotlib, we can use labelsize in the ticks_params()method. To display the figure, use show() method.
You need to set font family using pyplot
of matplotlib
.
import matplotlib.pyplot as plt
csfont = {'fontname':'Times New Roman'}
// write your code related to basemap here
plt.title('title',**csfont)
plt.show()
You can also use the following to change font globally.
import matplotlib.pyplot as plt
plt.rcParams["font.family"] = "Times New Roman"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With