Write a NumPy program to compute the x and y coordinates for points on a sine curve and plot the points using matplotlib
import numpy as np import matplotlib.pyplot as plt # Compute the x and y coordinates for points on a sine curve x = np.arange(0, 3 * np.pi, 0.2) y = np.sin(x) print("Plot the points using matplotlib:") plt.plot(x, y) plt.show()
Sample Output:
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:

need an explanation for this answer? contact us directly to get an explanation for this answer