

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 I plot a single point in Matplotlib Python?
To plot a 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 the current line style.
Plot 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 Questions & Answers
- How to plot one single data point in Matplotlib?
- How can I plot a confusion matrix in matplotlib?
- How can I plot hysteresis threshold in Matplotlib?
- How can I place a table on a plot in Matplotlib?
- How to plot a point on 3D axes in Matplotlib?
- How can matplotlib be used to plot 3 different datasets on a single graph in Python?
- How can I make a scatter plot colored by density in Matplotlib?
- How can I plot two different spaced time series on one same plot in Python Matplotlib?
- How do I plot a step function with Matplotlib in Python?
- Can I give a border to a line in Matplotlib plot function?
- How do I plot only a table in Matplotlib?
- How to a plot stem plot in Matplotlib Python?
- How can I get the output of a Matplotlib plot as an SVG?
- How to plot pie-chart with a single pie highlighted with Python Matplotlib?
- How can I plot NaN values as a special color with imshow in Matplotlib?
Advertisements