0
0
Matplotlibdata~5 mins

Font properties customization in Matplotlib - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of font properties in matplotlib?
Font properties control the appearance of text in plots, such as font family, size, weight, and style, to make the text clear and visually appealing.
Click to reveal answer
beginner
How do you change the font size of a title in matplotlib?
Use the fontsize parameter in the title() function, for example: plt.title('My Title', fontsize=14).
Click to reveal answer
beginner
What does the fontweight property control?
The fontweight property controls how thick or bold the text appears. Common values are 'normal', 'bold', and numeric weights like 700.
Click to reveal answer
intermediate
How can you set multiple font properties at once in matplotlib?
You can create a dictionary with font properties like {'family': 'serif', 'size': 12, 'weight': 'bold'} and pass it using the fontdict parameter, e.g., plt.xlabel('X', fontdict=font).
Click to reveal answer
intermediate
What is the difference between fontfamily and fontname in matplotlib?
fontfamily specifies a generic font category like 'serif' or 'sans-serif', while fontname specifies a specific font like 'Arial' or 'Times New Roman'.
Click to reveal answer
Which parameter changes the font size of axis labels in matplotlib?
Afontstyle
Bfontweight
Cfontcolor
Dfontsize
How do you make text bold in matplotlib?
ASet fontweight='bold'
BSet fontsize=20
CSet fontstyle='italic'
DSet fontfamily='serif'
What does the fontdict parameter do?
ASets multiple font properties at once
BChanges the plot background color
CAdjusts the plot size
DAdds grid lines
Which font property controls the font family category?
Afontsize
Bfontfamily
Cfontweight
Dfontstyle
If you want italic text, which property should you use?
Afontweight='italic'
Bfontsize=italic
Cfontstyle='italic'
Dfontfamily='italic'
Explain how to customize font properties for a plot title in matplotlib.
Think about parameters in plt.title() and how to pass a dictionary of font properties.
You got /5 concepts.
    Describe the difference between fontfamily and fontname in matplotlib font customization.
    Consider how you choose a broad font type versus a specific font face.
    You got /3 concepts.