import matplotlib.pyplot as pltimport numpy as np
x = np.linspace(1, 6, 100)y = 3 - x
plt.plot(x, y, label='y=3-x')
plt.xlabel('x')plt.ylabel('y')
plt.ylim(0, 4)
plt.legend()plt.grid(True)plt.show()
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(1, 6, 100)
y = 3 - x
plt.plot(x, y, label='y=3-x')
plt.xlabel('x')
plt.ylabel('y')
plt.ylim(0, 4)
plt.legend()
plt.grid(True)
plt.show()