Spaces:
Sleeping
Sleeping
Update pages/40_simpleline.py
Browse files- pages/40_simpleline.py +4 -4
pages/40_simpleline.py
CHANGED
@@ -10,14 +10,14 @@ b = st.slider('B (intercept)', min_value=-10.0, max_value=10.0, value=0.0, step=
|
|
10 |
y = w * x + b
|
11 |
|
12 |
# Create the plot
|
13 |
-
fig, ax = plt.subplots(figsize=(6,
|
14 |
-
ax.
|
15 |
-
ax.
|
16 |
ax.plot([x], [y], 'ro') # Plot the point
|
17 |
|
18 |
# Set plot limits and labels
|
19 |
ax.set_xlim(0, 10)
|
20 |
-
ax.set_ylim(-
|
21 |
ax.set_xlabel('X-axis')
|
22 |
ax.set_ylabel('Y-axis')
|
23 |
ax.set_title(f'y = {w} * x + {b}')
|
|
|
10 |
y = w * x + b
|
11 |
|
12 |
# Create the plot
|
13 |
+
fig, ax = plt.subplots(figsize=(6, 2))
|
14 |
+
ax.hlines(1, 0, 10, color='blue', linestyle='--') # First horizontal line
|
15 |
+
ax.hlines(0, 0, 10, color='blue', linestyle='--') # Second horizontal line
|
16 |
ax.plot([x], [y], 'ro') # Plot the point
|
17 |
|
18 |
# Set plot limits and labels
|
19 |
ax.set_xlim(0, 10)
|
20 |
+
ax.set_ylim(-1, 2)
|
21 |
ax.set_xlabel('X-axis')
|
22 |
ax.set_ylabel('Y-axis')
|
23 |
ax.set_title(f'y = {w} * x + {b}')
|