import streamlit as st
import numpy as np
import matplotlib.cm as cm
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt

N = 5
menMeans   = (20, 35, 30, 35, 27)
womenMeans = (25, 32, 34, 20, 25)
menStd     = (2, 3, 4, 1, 2)
womenStd   = (3, 5, 2, 3, 3)
ind = np.arange(N)    # the x locations for the groups
width = 0.35       # the width of the bars: can also be len(x) sequence

fig, ax = plt.subplots()
plt.savefig("output.jpg")
ax.bar(ind, menMeans,   width, color='r', yerr=womenStd, 
             align='center', label='Woman')

ax.bar(ind, womenMeans, width, color='y', yerr=menStd,
             bottom=menMeans, align='center', label='Men')

ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(ind)
ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5'))
ax.set_yticks(np.arange(0,81,10))

ax.plot(np.random.randint(20,50,5), 'o-', lw=2, color='k', label='Line')

ax.legend()
plt.show() 
st.pyplot(fig)