How to create varible-size bars

Hello everyone!!!

First of all, Streamlit is awesome. It saved me more than once when I want to show the progress of a DL model in a web app without knowing Web Programming.

I´m building a streamlit web app for an image classification problem. When the image is classified, it displays the image on the browser, together with its category. In addition, I display beside the image, all the percentages for each category in that classification.

I want to show, together with the display, some bars, where their length is proportional to the percentage shown on each category to have an easy visual aid to the percentage number.

Is it possible to do it in Streamlit? I searched a lot and couldn´t find it.

Thanks in advance!

Hi @Luciano, welcome to the Streamlit community!

At its simplest, st.bar_chart sounds like what you are looking for. But really, most of the popular plotting libraries are supported in Streamlit, so it’s a matter of choosing your favorite and then looking up examples in their documentation.

Do you have a repo you can share?


1 Like