- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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 can data that has multiple variables be visualized using Seaborn in Python?
Seaborn is a library that helps in visualizing data. It comes with customized themes and a high level interface. In real-time situations, dataset contains many variables. Sometimes, it may be required to analyse the relationship of every variable with every other variable in the dataset. In such situations, bivariate distribution may take up too much time and may get complicated as well.
This is where multiple pairwise bivariate distribution comes into picture. The ‘pairplot’ function can be used to get the relationship between combinations of variables in a dataframe. The output would be a univariate plot.
Syntax of pairplot function
Now let us understand how it can be plotted on a graph −
import pandas as pd import seaborn as sb from matplotlib import pyplot as plt my_df = sb.load_dataset('iris') sb.set_style("ticks") sb.pairplot(my_df,hue = 'species',diag_kind = "kde",kind = "scatter",palette = "husl") plt.show()
- The required packages are imported.
- The input data is ‘iris_data’ which is loaded from the scikit learn library.
- This data is stored in a dataframe.
- The ‘load_dataset’ function is used to load the iris data.
- This data is visualized using the ‘pairplot’ function.
- Here, the dataframe is supplied as parameter.
- Here, the ‘kind’ parameter is specified as ‘kde’ so that the plot understands to print kernel density estimation.
- The type of plot is mentioned as a scatterplot.
- This data is displayed on the console.
- How can multiple lines be visualized using Bokeh Python?
- How can a linear relationship be visualized using Seaborn in Python?
- How can bar graphs be visualized using Bokeh?
- How can patch plot with multiple patches be visualized in Bokeh?
- How can axis aligned rectangles be visualized using Python and Bokeh?
- How can data be represented visually using ‘seaborn’ library in Python?
- How can a Beizer curve be visualized using Bokeh?
- How can a vertical bar graph be visualized using Bokeh and Python?
- Explain how a violin plot can be visualized using factorplot function in Python?
- How can factorplot be used in Seaborn to visualize data in Python?
- How can FacetGrid be used to visualize data in Python Seaborn Library?
- How can the data be visualized to support interactive decision tree construction?
- How can the countplot be used to visualize data in Python Seaborn Library?
- How can bar plot be used in Seaborn library in Python?