Untitled

mail@pastecode.io avatar
unknown
plain_text
19 days ago
571 B
2
Indexable
Never
import numpy as np
import matplotlib.pyplot as plt

# Define the range of x values
x = np.linspace(-100, 100, 400)
# Calculate y values based on the equation
y = 0.15 * x + 22

# Create the plot
plt.figure(figsize=(10, 6))
plt.plot(x, y, label='y = 0.15x + 22', color='blue')
plt.title('Graph of y = 0.15x + 22')
plt.xlabel('x')
plt.ylabel('y')
plt.axhline(0, color='black',linewidth=0.5, ls='--')
plt.axvline(0, color='black',linewidth=0.5, ls='--')
plt.grid(color = 'gray', linestyle = '--', linewidth = 0.5)
plt.legend()
plt.xlim(-100, 100)
plt.ylim(0, 30)
plt.show()
Leave a Comment