eaglelandsonce commited on
Commit
e6adb31
·
verified ·
1 Parent(s): ee91411

Update pages/40_simpleline.py

Browse files
Files changed (1) hide show
  1. pages/40_simpleline.py +8 -7
pages/40_simpleline.py CHANGED
@@ -1,13 +1,14 @@
1
  import streamlit as st
2
  import matplotlib.pyplot as plt
3
 
4
- # Add space above sliders
5
- st.markdown("<br><br><br><br><br>", unsafe_allow_html=True)
6
-
7
- # Initialize sliders
8
- x = st.slider('X position', min_value=-100.0, max_value=100.0, value=0.0, step=1.0)
9
- w = st.slider('W (slope)', min_value=-10.0, max_value=10.0, value=1.0, step=0.1)
10
- b = st.slider('B (intercept)', min_value=-100.0, max_value=100.0, value=0.0, step=1.0)
 
11
 
12
  # Calculate y based on the equation y = w * x + b
13
  y = w * x + b
 
1
  import streamlit as st
2
  import matplotlib.pyplot as plt
3
 
4
+ # Title
5
+ st.title("Interactive Equation Plotter")
6
+
7
+ # Sidebar sliders
8
+ st.sidebar.header("Controls")
9
+ x = st.sidebar.slider('X position', min_value=-100.0, max_value=100.0, value=0.0, step=1.0)
10
+ w = st.sidebar.slider('W (slope)', min_value=-10.0, max_value=10.0, value=1.0, step=0.1)
11
+ b = st.sidebar.slider('B (intercept)', min_value=-100.0, max_value=100.0, value=0.0, step=1.0)
12
 
13
  # Calculate y based on the equation y = w * x + b
14
  y = w * x + b