- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to plot a non-square Seaborn jointplot or JointGrid? (Matplotlib)
To plot a non-square Seaborn jointplot or jointgrid, we can use set_figwidth() and set_figheight() methods.
Steps
- Set the figure size and adjust the padding between and around the subplots.
- Create x and y data points using numpy.
- Create a dataframe with two columns.
- Use jointplot() method to plot the jointplot.
- To make it non-square, we can set the figure width and height.
- To display the figure, use show() method.
Example
import seaborn as sns import numpy as np from matplotlib import pyplot as plt import pandas as pd plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True X = np.random.randn(1000,) Y = 0.2 * np.random.randn(1000) + 0.5 df = pd.DataFrame(dict(x=X, y=Y)) jp = sns.jointplot(x="x", y="y", data=df, height=3.5, joint_kws={'color': 'red'}) jp.fig.set_figwidth(7.50) jp.fig.set_figheight(3.50) plt.show()
Output
- Related Articles
- How to plot multiple Seaborn Jointplot in Subplot using Matplotlib?
- How to plot a jointplot with 'hue' parameter in Seaborn? (Matplotlib)
- How to customize the axis label in a Seaborn jointplot using Matplotlib?
- How to remove or hide X-axis labels from a Seaborn / Matplotlib plot?
- How to save a plot in Seaborn with Python (Matplotlib)?
- How to plot multiple histograms on same plot with Seaborn using Matplotlib?
- How to plot a dashed line on a Seaborn lineplot in Matplotlib?
- How to make a heatmap square in Seaborn FacetGrid using Matplotlib?
- How to plot two Seaborn lmplots side-by-side (Matplotlib)?
- How to add a legend on Seaborn facetgrid bar plot using Matplotlib?
- Add minor gridlines to Matplotlib plot using Seaborn
- How to change the line color in a Seaborn linear regression jointplot?
- How to animate a Seaborn heatmap or correlation matrix(Matplotlib)?
- How to plot a time series graph using Seaborn or Plotly?
- Add a custom border to certain cells in a Matplotlib / Seaborn plot

Advertisements