python add a point to a plot

Solutions on MaxInterview for python add a point to a plot by the best coders in the world

showing results for - "python add a point to a plot"
Pietro
22 Oct 2020
1# Basic syntax
2plt.plot(x, y, 'marker')
3
4# Example usage:
5import matplotlib.pyplot as plt
6import numpy as np
7
8# Data to plot
9x = np.linspace(0, 10, 100)
10
11# Plot figure
12fig = plt.figure()
13plt.plot(x, np.sin(x), '-')
14
15# Add point
16plt.plot(5, 0, 'ro')
17
18# Note, see all marker styles here:
19#    https://matplotlib.org/stable/api/markers_api.html