Originally I can set the figure title to bold by the following:
import Matplotlib.pyplot as plt
plt.title("Test",fontweight="bold")
but once I use fontname="Times New Roman"
, fontweight="bold"
just won't result in any change at all:
import Matplotlib.pyplot as plt
plt.title("Test",fontname="Times New Roman",fontweight="bold")
How shall I set the figure title to bold?
The size and font of title and axes in Matplotlib can be set by adjusting fontsize parameter, using set_size() method, and changing values of rcParams dictionary.
The title() method in matplotlib module is used to specify title of the visualization depicted and displays the title using various attributes.
There's a bold times font of its own, assuming it's installed on your system:
plt.title("Test", fontname="Times New Roman Bold")
You can find a list of fonts on your system here: How to get a list of all the fonts currently available for Matplotlib?
I have:
>>> [i for i in matplotlib.font_manager.findSystemFonts(fontpaths=None, fontext='ttf')
if 'times' in i.lower()]
['/Library/Fonts/Times New Roman.ttf',
'/Library/Fonts/Times New Roman Italic.ttf',
'/Library/Fonts/Times New Roman Bold Italic.ttf',
'/Library/Fonts/Times New Roman Bold.ttf']
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