You can use plt.plot()
to plot a sinple point on an existing plot in Python Matplotlib.
Method 1: Just a single point on the plot
The following plot a point of (-3, 1)
in a plot using Matplotlib
in Python.
import matplotlib.pyplot as plt
plt.plot(-3, 1, marker="o", markersize=5, color="red")
plt.show()
Method 2: Add a point in an exsting plot
We ccan add a single data point in an exisiting point. Below is an example showing how to add a point showing the bottom of a bell shap line.
import matplotlib.pyplot as plt
import pandas as pd
def function_1(x):
return x**2+6*x+10
data_XY ={"X":range(-15, 12, 1)}
data_XY=pd.DataFrame(data_XY)
data_XY["Y"]=function_1(data_XY["X"])
plt.plot(data_XY["X"], data_XY["Y"],c="Black")
Add a point showing the bottom of the bell shape.
plt.plot(-3, 1, marker="o", markersize=5, color="red")
plt.show()