Skip to content

Feature Request: save FacetGrids seperately. #3856

Open
@cemde

Description

@cemde

I love using the FacetGrid plots for their convenience. However, most of the time I do not want to include a single multi-panel plot in latex. Rather, I want to import multiple figures, so I can tag them seperately as subfigures. On top, getting margins, styling etc consistent is much easier this way.

This workflow producing 1 pdf file

    g = sns.relplot(
        data=df, x="x", y="y", col="a", row="b"
    )
    plt.savefig(os.path.join(figure_dir, "all_figures.pdf"), bbox_inches="tight", dpi=300)
    plt.close()

could become something like

    g = sns.relplot(
        data=df, x="x", y="y", col="a", row="b"
    )
    g.savefig(os.path.join(figure_dir, "all_figures_a_{{col}}_b_{{row}}.pdf"), bbox_inches="tight", dpi=300, individual_subfigures=True)
    plt.close()

which produces $|a| \times |b|$ pdf files. Handling legends outside the figures requires some consideration, but I think that would be very handy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions