Informatics Practices

Plot a line graph for: y2 = 4*x

PyPlot

3 Likes

Answer

import matplotlib.pyplot as plt
import numpy as np
x = np.arange(1, 5)
y = np.sqrt(4 * x)
plt.plot(x, y)
plt.title('Line Graph of y² = 4x')
plt.xlabel('x')
plt.ylabel('y')
plt.show()
Output
Plot a line graph for: y^2 = 4\*x. Data Visualization using Matplotlib, Informatics Practices Preeti Arora Solutions CBSE Class 12

Answered By

2 Likes


Related Questions