import matplotlib.pyplot as plt
import numpy as np
def plot_linear_function():
x = np.linspace(-5, 5, 100)
y = -4 * x + 1
plt.figure(figsize=(8, 6))
plt.plot(x, y, color='blue', linewidth=2)
plt.xlim(-5, 5)
plt.ylim(-1, 20)
plt.axhline(y=0, color='k', linestyle='--', linewidth=0.5)
plt.axvline(x=0, color='k', linestyle='--', linewidth=0.5)
plt.title('Линейная функция', fontsize=14)
plt.xlabel('X', fontsize=12)
plt.ylabel('Y', fontsize=12)
plt.grid(True, linestyle=':', alpha=0.7)
plt.tight_layout()
plt.show()
if __name__ == "__main__":
plot_linear_function()