Spot the bug in the batch chart renderer

from Matplotlib
Python 3.14 intermediate 4 min 2 issues to find

Find the tick-label and lifecycle bugs in this batch renderer.

Python
import matplotlib.pyplot as plt

def save_reports(series_by_name):
    for name, values in series_by_name.items():
        fig, ax = plt.subplots()
        ax.bar(range(len(values)), values)
        ax.set_xticklabels(["A", "B", "C"])
        fig.savefig(f"{name}.png")
Open in playground
Report an error