File size: 995 Bytes
fe50ad7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import streamlit as st
import time
import numpy as np
import plotly.graph_objects as go


st.set_page_config(page_title="Plotting Demo", page_icon="πŸ“ˆ")


st.markdown("<h1><center>Plotting Emotion Sentiments</center></h1>",
            unsafe_allow_html=True)
# st.sidebar.header("---")


if 'color' not in st.session_state:
    st.session_state.colors = [
        '#FF595E', '#323e5d', '#8AC926', '#ff9494', '#6A4C93', '#2A2B2D', '#F6AE2D']


# Create a bar chart
fig = go.Figure(data=[go.Bar(
    x=list(st.session_state.emotion_counts.keys()),
    y=list(st.session_state.emotion_counts.values()),
    marker=dict(
        color=st.session_state.colors
    )
)])

# Update layout for better visualization and set figure size
fig.update_layout(
    title='Emotion Counts',
    xaxis=dict(title='Emotion Categories'),
    yaxis=dict(title='Count'),
    width=800,  # Set the width of the figure
    height=500  # Set the height of the figure

)

st.plotly_chart(fig, use_container_width=True)