a11
a11

Reputation: 3396

Seaborn jointplot turn off one of the marginal plots

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

Upvotes: 9

Views: 2778

Answers (1)

BigBen
BigBen

Reputation: 50162

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).

Upvotes: 7

Related Questions