Plotly express label and legend in streamlit

Hi team
the following is my code:

from plotly.subplots import make_subplots
import plotly.graph_objects as go
import plotly.express as px
import streamlit as st

#index is date
fig1 = px.line(plot_df2,y=['price','counting'],template="plotly_dark"})
fig2 = px.line(plot_df3,y=['price','counting'],template="plotly_dark")
fig = make_subplots(rows=1, cols=2)
fig.add_trace(fig1['data'][0], row=1, col=1)
fig.add_trace(fig1['data'][1], row=1, col=1)
fig.add_trace(fig2['data'][0], row=1, col=2)
fig.add_trace(fig2['data'][1], row=1, col=2 
st.plotly_chart(fig, theme=None, use_container_width=True)     

i want to add labels like price and count and legend like ‘the dataset plot’ to the code how can i do it?

Hey @hasti_hakhamanesh,

Have you checked out Plotly’s docs on adding labels and legends?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.