Spaces:
Sleeping
Sleeping
eaglelandsonce
commited on
Update pages/40_simpleline.py
Browse files- 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 |
-
#
|
5 |
-
st.
|
6 |
-
|
7 |
-
#
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
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
|