Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics. The colors stand out, the layers blend nicely together, the contours flow throughout, and the overall package not only has a nice aesthetic quality, but it provides meaningful insights to us as well.
Draw a line plot with the possibility of several semantic groupings. The relationship between x and y can be shown for different subsets of the data using the hue, size, and style parameters. These parameters control what visual semantics are used to identify the different subsets. It is possible to show up to three dimensions independently by using all three semantic types, but this style of plot can be hard to interpret and is often ineffective. Using redundant semantics (i.e. both hue and style for the same variable) can be helpful for making graphics more accessible.
Syntax : sns.lineplot(x=None, y=None, hue=None, size=None, style=None, data=None, palette=None, hue_order=None, hue_norm=None, sizes=None, size_order=None, size_norm=None, dashes=True, markers=None, style_order=None, units=None, estimator=’mean’, ci=95, n_boot=1000, sort=True, err_style=’band’, err_kws=None, legend=’brief’, ax=None, **kwargs,)
x, y: Input data variables; must be numeric. Can pass data directly or reference columns in data.
hue: Grouping variable that will produce lines with different colors. Can be either categorical or numeric, although color mapping will behave differently in latter case.
style: Grouping variable that will produce lines with different dashes and/or markers. Can have a numeric dtype but will always be treated as categorical.
data: Tidy (“long-form”) dataframe where each column is a variable and each row is an observation.
markers: Object determining how to draw the markers for different levels of the style variable.
legend: How to draw the legend. If “brief”, numeric “hue“ and “size“ variables will be represented with a sample of evenly spaced values.
Below is the implementation of above method with some examples :
Example 2 :
- Python - seaborn.jointplot() method
- Python - seaborn.factorplot() method
- Python - seaborn.lmplot() method
- Seaborn.barplot() method in Python
- Python - seaborn.pairplot() method
- Python - seaborn.FacetGrid() method
- Python - seaborn.PairGrid() method
- Python - seaborn.regplot() method
- Python - seaborn.pointplot() method
- Python - seaborn.residplot() method
- Python - seaborn.boxenplot() method
- Python - seaborn.swarmplot() method
- Boxplot using Seaborn in Python
- Grid Plot in Python using Seaborn
- Countplot using seaborn in Python
- Lineplot using Seaborn in Python
- Barplot using seaborn in Python
- Scatterplot using Seaborn in Python
- Violinplot using Seaborn in Python
- Swarmplot using Seaborn in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.