Matplotlib Mastery Quiz

10:00

Test your command of Figures, Axes, formatting, date axes, seaborn and chart export. · 10 questions

Question 1 of 10
In Matplotlib, what does a single `Axes` object represent?
Question 2 of 10
Which call is the recommended way to create a figure and one Axes in object-oriented style?
Question 3 of 10
Which file format is best for a chart that must stay crisp at any zoom level on a website?
Question 4 of 10
Why should you avoid using only red vs green to separate profit and loss series?
Question 5 of 10
What will the y-axis tick for 2500000 display?
from matplotlib.ticker import FuncFormatter
ax.yaxis.set_major_formatter(FuncFormatter(lambda x, pos: f'₹{x/1e5:.0f}L'))
Question 6 of 10
By default, what do the bar heights in `sns.barplot(data=df, x='city', y='sales')` show?
Question 7 of 10
Which formatter gives compact, non-repetitive multi-level date labels automatically?
Question 8 of 10
Why is `sharey=True` important in a small-multiples dashboard?
Question 9 of 10
A Django view generates a chart on every request and memory keeps growing. What is the most likely fix?
def chart(request):
    fig, ax = plt.subplots()
    ax.plot(get_data())
    buf = io.BytesIO()
    fig.savefig(buf, format='png')
    return HttpResponse(buf.getvalue(), content_type='image/png')
Question 10 of 10
You plot daily sales where the date column holds strings like '05-04-2025'. Ticks are crowded and the spacing ignores missing days. What is the best fix?