Title
#beginners-need-help
beats-like-a-helix

beats-like-a-helix

03/04/2022, 8:32 PM
Found a workaround, which is to specify the format in the dictionary key, but this doesn't feel right, as it's not what the documentation suggests:
python
plots_dict = dict()
for colour in ["blue", "green", "red"]:
    plots_dict[f"{colour}.pdf"] = plt.figure()
    plt.plot([1, 2, 3], [4, 5, 6], color=colour)
plt.close("all")
dict_plot_writer = MatplotlibWriter(
    filepath="matplotlib_dict",
    save_args={
        # "format": "pdf",
        "dpi": 300,
        "bbox_inches": "tight",
    },
)
dict_plot_writer.save(plots_dict)