Create a collection of the most bieutiful plotly plot you can generate. A those should be display in a streamlit application
To upload files, please first save the app
import streamlit as st
import plotly.express as px
import numpy as np
import pandas as pd
st.title('Beautiful Plotly Plots')
# Create some sample data
np.random.seed(42)
data = pd.DataFrame({
'x': np.linspace(0, 10, 100),
'y': np.sin(np.linspace(0, 10, 100)),
'category': np.random.choice(['A', 'B', 'C'], 100)
})
# Line Chart
fig1 = px.line(data, x='x', y='y', color='category', title='Line Chart', markers=True)
st.plotly_chart(fig1, use_container_width=True)
# Scatter Plot
fig2 = px.scatter(data, x='x', y='y', color='category', size='y', hover_name='category', title='Scatter Plot')
st.plotly_chart(fig2, use_container_width=True)
# Bar Chart
bar_data = data.groupby('category').mean().reset_index()
fig3 = px.bar(bar_data, x='category', y='y', title='Bar Chart', color='category', text='y')
st.plotly_chart(fig3, use_container_width=True)
# Box Plot
fig4 = px.box(data, x='category', y='y', title='Box Plot')
st.plotly_chart(fig4, use_container_width=True)
# Area Chart
fig5 = px.area(data, x='x', y='y', color='category', title='Area Chart')
st.plotly_chart(fig5, use_container_width=True)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?