 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- 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 change the line color in a Seaborn linear regression jointplot?
To change the line color in seaborn linear regression jointplot, we can use joint_kws in jointplot() method.
Steps
- Set the figure size and adjust the padding between and around the subplots.
- Create x and y data points using numpy to make a Pandas dataframe.
- Use jointplot() method with joint_kws in the arguments.
- 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)) g = sns.jointplot(x="x", y="y", data=df, kind='reg', height=3.5, joint_kws={'color':'green'}) plt.show() Output

Advertisements
 