KnowledgeBoat Logo
|

Informatics Practices

plt.plot(A, B) produces (A and B are the sequences same as created in question 1) chart as :

plt.plot(A, B) produces (A and B are the sequences same as created in question 3) chart as : Plotting with Pyplot, Informatics Practices Computer Science Sumita Arora Solutions CBSE Class 12

Write code to produce charts as shown below:

plt.plot(A, B) produces (A and B are the sequences same as created in question 3) chart as : Plotting with Pyplot, Informatics Practices Computer Science Sumita Arora Solutions CBSE Class 12

PyPlot

3 Likes

Answer

import numpy as np
import matplotlib.pyplot as plt

A = np.arange(2, 20, 2)
B = np.log(A)
C = np.log(A) * 1.2 
plt.plot(A, B)
plt.plot(A, C)
plt.show()
Output
plt.plot(A, B) produces (A and B are the sequences same as created in question 1) chart as : Plotting with Pyplot, Informatics Practices Computer Science Sumita Arora Solutions CBSE Class 12
import numpy as np
import matplotlib.pyplot as plt

A = np.arange(2, 20, 2)
B = np.log(A)
C = np.log(A) * (-1.2) 
plt.plot(A, B)
plt.plot(A, C)
plt.show()
Output
plt.plot(A, B) produces (A and B are the sequences same as created in question 1) chart as : Plotting with Pyplot, Informatics Practices Computer Science Sumita Arora Solutions CBSE Class 12

Answered By

3 Likes


Related Questions