Вот построенные графики функций:
1. y = x (желтая линия)
2. y = -x (оранжевая линия)
3. y = 3x - 1 (розовая линия)
4. y = -2.5x + 1 (красная линия)
5. y = 4 (голубая линия)
![](https://otvet.imgsmail.ru/download/22931335_949abd64cb347b18abfc9260312bd25c_800.png)
olimchikМастер (1101)
1 месяц назад
import matplotlib.pyplot as plt
import numpy as np
# Define the range of x values
x = np.linspace(-10, 10, 400)
# Define the functions
y1 = x
y2 = -x
y3 = 3 * x - 1
y4 = -2.5 * x + 1
y5 = 4 * np.ones_like(x)
# Create the plot
plt.figure(figsize=(10, 6))
# Plot each function
plt.plot(x, y1, label='y = x')
plt.plot(x, y2, label='y = -x')
plt.plot(x, y3, label='y = 3x - 1')
plt.plot(x, y4, label='y = -2.5x + 1')
plt.plot(x, y5, label='y = 4')
# Add a legend
plt.legend()
# Add labels and title
plt.xlabel('x')
plt.ylabel('y')
plt.title('Graphs of functions')
# Show grid
plt.grid(True)
# Show the plot
plt.show()
Построить графики функций:
у=х
у=-х
у=3х-1
у=-2,5х+1
у=4