Seaborn jointplot turn off one of the marginal plots

Viewed 522

Is there a way to turn off the top marginal plot in a Seaborn Jointplot?

tips = sns.load_dataset('tips')
g = sns.jointplot(
    data=tips,
    x="total_bill",
    y="tip",
    hue="smoker",
)

enter image description here

1 Answers

Perhaps just call remove on .ax_marg_x.

g.ax_marg_x.remove()

Output:

enter image description here

(Note that ax_marg_y and ax_joint are the remaining plots, as detailed in the JointGrid docs).

Related