- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 to plot one single data point in Matplotlib?
To plot one single data point in matplotlib, we can take the following steps −
Initialize a list for x and y, with a single value.
Limit x and y axis range for 0 to 5.
Lay out a grid in current line style.
Plot given x and y using plot() method, with marker="o", markeredgecolor="red", markerfacecolor="green".
To display the figure, use show() method.
Example
from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True x = [4] y = [3] plt.xlim(0, 5) plt.ylim(0, 5) plt.grid() plt.plot(x, y, marker="o", markersize=20, markeredgecolor="red", markerfacecolor="green") plt.show()
Output
- Related Articles
- How can I plot a single point in Matplotlib Python?
- How to plot single data with two Y-axes (two units) in Matplotlib?
- How to plot a line in Matplotlib with an interval at each data point?
- How to plot a point on 3D axes in Matplotlib?
- How to extract data from a Matplotlib plot?
- How to plot a single line in Matplotlib that continuously changes color?
- How to plot true/false or active/deactive data in Matplotlib?
- How to plot a line graph from histogram data in Matplotlib?
- How to plot data into imshow() with custom colormap in Matplotlib?
- How to plot CSV data using Matplotlib and Pandas in Python?
- How to plot multiple horizontal bars in one chart with matplotlib?
- How to merge two existing Matplotlib plots into one plot?
- How to add a single data point in an Excel line chart?
- How to plot pie-chart with a single pie highlighted with Python Matplotlib?
- Plot multiple time-series DataFrames into a single plot using Pandas (Matplotlib)

Advertisements