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?
✗ Incorrect
The
fontsize parameter controls the size of the font for axis labels.How do you make text bold in matplotlib?
✗ Incorrect
The
fontweight property set to 'bold' makes text bold.What does the
fontdict parameter do?✗ Incorrect
fontdict lets you pass a dictionary of font properties to style text.Which font property controls the font family category?
✗ Incorrect
fontfamily sets the generic font category like serif or sans-serif.If you want italic text, which property should you use?
✗ Incorrect
The
fontstyle property set to 'italic' makes text 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.