A joint plot shows the relationship between two variables with bivariate and univariate graphs. We can use the seaborn.jointplot() function to plot a joint plot using the seaborn Python library.
Let’s read the tips dataset from the seaborn library. The dataset contains various information, such as total bill amount, tips, etc. In this example, we will plot a joint plot between the total bill and tip amount.
We can use the following Python code to plot a jointplot using the seaborn Python library.
import seaborn from matplotlib import pyplot df = seaborn.load_dataset("tips") seaborn.jointplot(data=df, x="total_bill", y="tip", kind=”scatter”) pyplot.savefig("seaborn-jointplot.png") pyplot.close()
Please note that here we are using scatter as the underlying plotting function. We can also use kde, hist, etc. as the underlying plotting function. The resulting joint plot will look like the following:






0 Comments