Hi,
I want to plot the bar charts on the web page. I am able to plot charts but the grids are not displaying in all the charts, it is displaying only in alternate charts as shown in the picture.
Below is the method that generates the charts.
def generate(safety_met,values):
plt.bar(safety_met, values, color ='maroon',
width = 0.4)
plt.xlabel("Safety Factor")
plt.ylabel("Values")
plt.title("Safety Factor")
plt.grid()
#plt.show()
st.pyplot(fig)
expanders = []
if 'expanders' not in st.session_state:
st.session_state.expanders = expanders
else:
expanders = st.session_state.expanders
num_expanders = 1
for _ in range(num_expanders):
expanders.append(True)
for i, expander in enumerate(expanders):
with st.expander(f'Expander {i+1}',expanded=True):
st.write(generate(safety_met,values))
print("exppp",expanders)
else:
st.warning("Limit exhausted")