import streamlit as st import pandas as pd import plotly.express as px data = { 'Model': ['code-davinci-edit-001', 'gpt-3.5-turbo', 'code-davinci-002'] , '0-shot pass@1': [12.18, 13.43, 6.29], '0-shot pass@5': [28.86, 13.43, 19.8], '0-shot pass@100': [54.12, 13.43, 45.91], '1-shot pass@1': [4.73, 16.22, 3.92], '1-shot pass@5': [12.75, 31.93, 14.34], '1-shot pass@100': [30.24, 56.93, 40.09], } df = pd.DataFrame(data) st.dataframe(df) sb_options = list(df.columns) sb_options.remove('Model') colselect1,colselect2 = st.columns(2) with colselect1: sel_metric = st.selectbox('Metric', options=sb_options) # Create a new dataframe for plotting. Sort it for plotting display. # If metric value is the same, display name by alphabetic order. df_metric = df.copy() df_metric = df_metric.sort_values(by=[sel_metric, 'Name'], ascending=[True, False]) plot_assym = px.bar(df_metric, x=sel_metric, y="Name", template="plotly_white", text_auto=True) st.plotly_chart(plot_assym)