Spaces:
Sleeping
Sleeping
Update pages/video.py
Browse files- pages/video.py +26 -1
pages/video.py
CHANGED
|
@@ -1,4 +1,29 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import numpy as np
|
| 3 |
import matplotlib.pyplot as plt
|
| 4 |
-
import seaborn as sns
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import numpy as np
|
| 3 |
import matplotlib.pyplot as plt
|
| 4 |
+
import seaborn as sns
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
# Title of the app
|
| 8 |
+
st.title("Dynamic Grid Generator")
|
| 9 |
+
|
| 10 |
+
# Add a slider to control grid size
|
| 11 |
+
grid_size = st.slider("Select the grid size", min_value=2, max_value=50, value=10, step=1)
|
| 12 |
+
|
| 13 |
+
# Create the grid
|
| 14 |
+
fig, ax = plt.subplots(figsize=(5, 5))
|
| 15 |
+
|
| 16 |
+
# Draw the grid
|
| 17 |
+
for x in np.linspace(0, 1, grid_size + 1):
|
| 18 |
+
ax.axhline(x, color='black', linewidth=0.5)
|
| 19 |
+
ax.axvline(x, color='black', linewidth=0.5)
|
| 20 |
+
|
| 21 |
+
# Adjust plot settings
|
| 22 |
+
ax.set_xticks([])
|
| 23 |
+
ax.set_yticks([])
|
| 24 |
+
ax.set_xlim(0, 1)
|
| 25 |
+
ax.set_ylim(0, 1)
|
| 26 |
+
ax.set_aspect('equal', adjustable='box')
|
| 27 |
+
|
| 28 |
+
# Display the grid
|
| 29 |
+
st.pyplot(fig)
|