Plotting graph For IRIS Dataset Using Seaborn And Matplotlib Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report Matplotlib.pyplot library is most commonly used in Python in the field of machine learning. It helps in plotting the graph of large dataset. Not only this also helps in classifying different dataset. It can plot graph both in 2d and 3d format. It has a feature of legend, label, grid, graph shape, grid and many more that make it easier to understand and classify the dataset. Seaborn provides a beautiful with different styled graph plotting that make our dataset more distinguishable and attractive. Installation To install the package write the below code in terminal of ubuntu/Linux or Window Command prompt. pip install matplotlib pip install seaborn Attribute Information about data set: Attribute Information: -> sepal length in cm -> sepal width in cm -> petal length in cm -> petal width in cm -> class: Iris Setosa Iris Versicolour Iris Virginica Number of Instances: 150 Summary Statistics: Min Max Mean SD Class Correlation sepal length: 4.3 7.9 5.84 0.83 0.7826 sepal width: 2.0 4.4 3.05 0.43 -0.4194 petal length: 1.0 6.9 3.76 1.76 0.9490 (high!) petal width: 0.1 2.5 1.20 0.76 0.9565 (high!) Class Distribution: 33.3% for each of 3 classes. Plotting graph For IRIS Dataset Using Seaborn Library And matplotlib.pyplot library Loading data Python3 import numpy as np import pandas as pd import matplotlib.pyplot as plt data = pd.read_csv("Iris.csv") print (data.head(10)) Output: Plotting Using Matplotlib Python3 import pandas as pd import matplotlib.pyplot as plt iris = pd.read_csv("Iris.csv") plt.plot(iris.Id, iris["SepalLengthCm"], "r--") plt.show Scatter Plot Python3 iris.plot(kind ="scatter", x ='SepalLengthCm', y ='PetalLengthCm') plt.grid() Plotting using Seaborn Python3 import seaborn as sns iris = sns.load_dataset('iris') # style used as a theme of graph # for example if we want black # graph with grid then write "darkgrid" sns.set_style("whitegrid") # sepal_length, petal_length are iris # feature data height used to define # Height of graph whereas hue store the # class of iris dataset. sns.FacetGrid(iris, hue ="species", height = 6).map(plt.scatter, 'sepal_length', 'petal_length').add_legend() Comment More infoAdvertise with us Next Article Plotting graph For IRIS Dataset Using Seaborn And Matplotlib karnalrohit Follow Improve Article Tags : Machine Learning Write From Home python-modules Python-matplotlib python +1 More Practice Tags : Machine Learningpython Similar Reads Visualising ML DataSet Through Seaborn Plots and Matplotlib Working on data can sometimes be a bit boring. Transforming a raw data into an understandable format is one of the most essential part of the whole process, then why to just stick around on numbers, when we can visualize our data into mind-blowing graphs which are up for grabs in python. This articl 6 min read Data Visualisation in Python using Matplotlib and Seaborn It may sometimes seem easier to go through a set of data points and build insights from it but usually this process may not yield good results. There could be a lot of things left undiscovered as a result of this process. Additionally, most of the data sets used in real life are too big to do any an 14 min read Generate a Heatmap in MatPlotLib Using a Scatter Dataset Heatmaps are a powerful visualization tool that can help you understand the density and distribution of data points in a scatter dataset. They are particularly useful when dealing with large datasets, as they can reveal patterns and trends that might not be immediately apparent from a scatter plot a 5 min read Plotting graph using Seaborn | Python This article will introduce you to graphing in Python with Seaborn, which is the most popular statistical visualization library in Python. Installation: The easiest way to install seaborn is to use pip. Type following command in terminal:Â Â pip install seaborn OR, you can download it from here and i 7 min read Overlapping Histograms with Matplotlib in Python Histograms are used to represent the frequencies across various intervals in a dataset. In this article, we will learn how to create overlapping histograms in Python using the Matplotlib library. The matplotlib.pyplot.hist() function will be used to plot these histograms so that we can compare diffe 2 min read Half Violin Plot in Matplotlib A half violin plot is a variation of the traditional violin plot where only one half of the violin (either left or right) is displayed. This type of plot is particularly useful when you want to focus on one side of the distribution while keeping the plot clean and easier to read. Half violin plots a 5 min read Difference Between Matplotlib VS Seaborn Data Visualization is the graphic representation of data. It converts a huge dataset into small graphs, thus aiding in data analysis and predictions. It is an indispensable element of data science that makes complex data more understandable and accessible. Matplotlib and Seaborn act as the backbone 3 min read ML | Matrix plots in Seaborn Seaborn is a wonderful visualization library provided by python. It has several kinds of plots through which it provides the amazing visualization capabilities. Some of them include count plot, scatter plot, pair plots, regression plots, matrix plots and much more. This article deals with the matrix 4 min read Matplotlib.pyplot.sci() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 2 min read Violinplot in Python using axes class of Matplotlib Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 2 min read Like