Kvikontent commited on
Commit
260256e
·
verified ·
1 Parent(s): 179cfd5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -34,12 +34,12 @@ x = np.linspace(-10, 10, 400)
34
  y1 = (c1 - a1*x) / b1
35
  y2 = (c2 - a2*x) / b2
36
 
37
- plt.figure()
38
- plt.plot(x, y1, label='Equation 1')
39
- plt.plot(x, y2, label='Equation 2')
40
  if intersection is not None:
41
- plt.scatter(intersection[0], intersection[1], color='red', label='Intersection')
42
- plt.xlabel('x')
43
- plt.ylabel('y')
44
- plt.legend()
45
- st.pyplot()
 
34
  y1 = (c1 - a1*x) / b1
35
  y2 = (c2 - a2*x) / b2
36
 
37
+ fig, ax = plt.subplots()
38
+ ax.plot(x, y1, label='Уравнение 1')
39
+ ax.plot(x, y2, label='Уравнение 2')
40
  if intersection is not None:
41
+ ax.scatter(intersection[0], intersection[1], color='red', label='Пересечение')
42
+ ax.set_xlabel('x')
43
+ ax.set_ylabel('y')
44
+ ax.legend()
45
+ st.pyplot(fig)