How To Add Regression Line Per Group with Seaborn in Python? Last Updated : 25 Nov, 2020 Comments Improve Suggest changes Like Article Like Report In this article, we will learn how to add a regression line per group with Seaborn in Python. Seaborn has multiple functions to form scatter plots between two quantitative variables. For example, we can use lmplot() function to make the required plot. What is Regression Line? A regression line is just one line that most closely fits the info (in terms of getting the littlest overall distance from the road to the points). Statisticians call this system for locating the best-fitting line an easy rectilinear regression analysis using the smallest amount squares method. Steps Required Import Library.Import or create data.Use lmplot method. This method is used to add a regression line per group by simply adding the hue parameter with the categorical variable name.Use different arguments for better visualization. Example 1: Python3 # import libraries import seaborn # load data tip = seaborn.load_dataset('tips') # use lmplot seaborn.lmplot(x="total_bill", y="size", hue="sex", data=tip) Output: Example 2: Python3 # import libraries import seaborn # load data tip = seaborn.load_dataset('tips') # use lmplot seaborn.lmplot(x="total_bill", y="tip", hue="day", markers='*', data=tip) Output: Example 3: Python3 # import libraries import seaborn # load data iris = seaborn.load_dataset('iris') # use lmplot seaborn.lmplot(x="sepal_length", y="sepal_width", hue="species", markers='+', data=iris) Output: Comment More infoAdvertise with us Next Article Company Preparation D deepanshu_rustagi Follow Improve Article Tags : Python Python-Seaborn Practice Tags : python Similar Reads Interview PreparationInterview Preparation For Software DevelopersMust Coding Questions - Company-wise Must Do Coding Questions - Topic-wiseCompany-wise Practice ProblemsCompany PreparationCompetitive ProgrammingSoftware Design-PatternsCompany-wise Interview ExperienceExperienced - Interview ExperiencesInternship - Interview ExperiencesPractice @GeeksforgeeksProblem of the DayTopic-wise PracticeDifficulty Level - SchoolDifficulty Level - BasicDifficulty Level - EasyDifficulty Level - MediumDifficulty Level - HardLeaderboard !!Explore More...Data StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvance Data StructuresMatrixStringAll Data StructuresAlgorithmsAnalysis of AlgorithmsSearching AlgorithmsSorting AlgorithmsPattern SearchingGeometric AlgorithmsMathematical AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide & ConquerBacktrackingBranch & BoundAll AlgorithmsProgramming LanguagesCC++JavaPythonC#Go LangSQLPHPScalaPerlKotlinWeb TechnologiesHTMLCSSJavaScriptBootstrapTailwind CSSAngularJSReactJSjQueryNodeJSPHPWeb DesignWeb BrowserFile FormatsComputer Science SubjectsOperating SystemsDBMSComputer NetworkComputer Organization & ArchitectureTOCCompiler DesignDigital Elec. & Logic DesignSoftware EngineeringEngineering MathematicsData Science & MLComplete Data Science CourseData Science TutorialMachine Learning TutorialDeep Learning TutorialNLP TutorialMachine Learning ProjectsData Analysis TutorialTutorial LibraryPython TutorialDjango TutorialPandas TutorialKivy TutorialTkinter TutorialOpenCV TutorialSelenium TutorialGATE CSGATE CS NotesGate CornerPrevious Year GATE PapersLast Minute Notes (LMNs)Important Topic For GATE CSGATE CoursePrevious Year Paper: CS exams Like