Replicate the app from the image.
Drop files here
or click to upload
import streamlit as st
import numpy as np
import matplotlib.pyplot as plt
st.title('Scribble Visualization')
# Prepare data for random scribbles
def generate_scribbles(num_lines=10):
lines = []
for _ in range(num_lines):
x = np.linspace(-1, 1, 100)
y = np.sin(2 * np.pi * (x + np.random.rand())) + np.random.rand() * 0.5 * np.cos(3 * np.pi * x)
lines.append((x, y))
return lines
# Generate scribbles
lines = generate_scribbles(5)
# Create a plot
plt.figure(figsize=(8, 8))
for x, y in lines:
plt.plot(x, y, color='black')
# Highlighting specific paths
highlight_x = np.linspace(-0.2, 0.2, 100)
highlight_y = 0.5 * np.cos(3 * np.pi * highlight_x)
plt.plot(highlight_x, highlight_y, color='red')
plt.grid()
plt.title('Scribbles with Highlights')
plt.xlim(-1, 1)
plt.ylim(-1, 1)
# Show plot in Streamlit
st.pyplot(plt)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?