0

I have a seaborn jointplot:

import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt 
import numpy as np

def plot():
    random_matrix=np.random.standard_normal((1000,2))
    df=pd.DataFrame(random_matrix,columns=["x","y"])
    print(df)
    b=10
    plot=sns.jointplot(data=df,x="x", y="y",ratio=1,s=1,marginal_ticks=True,marginal_kws=dict(bins=b))
    plot.fig.suptitle("title")
    plot.figure.savefig("./plot.png")

That produces the following plot: plot

Now let's say that I have already fit a function to one of these histograms (let's say to the upper one). How could I plot this function on that histogram?

I just started to use the seaborn package so I have no intuition how one can do that. Before I plotted histograms and a scatter plot separately in matplotlib and put them together in such a composition but I want to use a more automatic tool and seaborn seems to be the one.

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158

0 Answers0