eaglelandsonce commited on
Commit
3359185
·
verified ·
1 Parent(s): 1b75d5f

Update pages/40_simpleline.py

Browse files
Files changed (1) hide show
  1. 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, 4))
14
- ax.axhline(y=2, color='blue', linestyle='--') # First horizontal line
15
- ax.axhline(y=-2, 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(-10, 10)
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}')