Plotly Bar Chart
Coming from an analyst background, I have been making bar charts for years. So, this example is not very interesting. However, it shows the simplicity of plotly express and how easily one can create a bar graph. I didn’t stray far from the path regarding the official plotly example. It is their example. However, I wanted to show how easy it is to get going. The only thing I modified was the graphic size in Google Colab. Very easy and approachable!
fig = px.bar(filtered_df, x="nation", y="count", color="medal", title="Long-Form Input")
fig.show()
The full example is located at: Google Colab
Without the layout update, this interactive graph is only one line of code. That is insanely easy!
The next step is to use a lower-level object. That is the graph object. It looks surprisingly simple, but wait, it will get complex quick! The example below takes two lists and creates a bar chart.
I like this example; we can see where the data comes from. We can create a quick graph if we feed lists to plotly. It is just that simple!
The next goal is to create an interactive dashboard with a dropdown.
Comments
Post a Comment