
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
Python - Draw a Scatter Plot for a Pandas DataFrame
Scatter Plot is a data visualization technique. Use the plot.scatter() to plot the Scatter Plot. At first, Let us import the required libraries −
We have our data with Team Records. Set it in the Pandas DataFrame −
data = [["Australia", 2500],["Bangladesh", 1000],["England", 2000],["India", 3000],["Srilanka", 1500]] dataFrame = pd.DataFrame(data, columns=["Team","Rank_Points"])
Let us plot now with the columns −
dataFrame.plot.scatter(x="Team", y="Rank_Points")
Example
Following is the code −
import pandas as pd import matplotlib.pyplot as mp # our data data = [["Australia", 2500],["Bangladesh", 1000],["England", 2000],["India", 3000],["Srilanka", 1500]] # dataframe dataFrame = pd.DataFrame(data, columns=["Team","Rank_Points"]) # scatter plot the dataframe dataFrame.plot.scatter(x="Team", y="Rank_Points") # displaying scatter plot mp.show()
Output
This will produce the following output
- Related Articles
- Python - Plot a Histogram for Pandas Dataframe with Matplotlib?
- Create a Scatter Plot with SeaBorn – Python Pandas
- Python - Plot a Pie Chart for Pandas Dataframe with Matplotlib?
- Python - Plot a Pandas DataFrame in a Line Graph
- Plot a Line Graph for Pandas Dataframe with Matplotlib?
- How to label bubble chart/scatter plot with column from Pandas dataframe?
- Python Pandas - Plot multiple data columns in a DataFrame?
- Python Pandas - Draw a boxplot for each numeric variable in a DataFrame with Seaborn
- How to draw an average line for a scatter plot in MatPlotLib?
- Python - How to plot a Pandas DataFrame in a Bar Graph
- How to make a scatter plot for clustering in Python?
- Compare specific Timestamps for a Pandas DataFrame – Python
- Frequency plot in Python/Pandas DataFrame using Matplotlib
- How to plot a Pandas Dataframe with Matplotlib?
- How to plot an area in a Pandas dataframe in Matplotlib Python?

Advertisements