7

I have an array of 90 000 pairs I want to plot with seaborn jointplot. Is there a way to adjust side histograms bin size? Should I try to plot it with an other package?enter image description here

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Sylvain
  • 253
  • 2
  • 7
  • 18

1 Answers1

11

You should be able to use marginal_kws to adjust the bins. Lifting the example from the seaborn documentation here

Tested in python 3.10, matplotlib 3.5.1, seaborn 0.11.2

import seaborn as sns

# load sample data
iris = sns.load_dataset('iris')

g = sns.jointplot(x="petal_length", y="sepal_length", data=iris,
                   marginal_kws=dict(bins=30), s=40)

enter image description here

  • without using marginal_kws
g = sns.jointplot(x="petal_length", y="sepal_length", data=iris, s=40)

enter image description here

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
iayork
  • 6,420
  • 8
  • 44
  • 49