plotly bar chart code example
Example 1: matplotlib bar chart
import matplotlib.pyplot as plt
names = ["Brad", "Bill", "Bob"]
ages = [9, 5, 10]
plt.bar(names, ages)
plt.show()
Example 2: ploly bar chart
import plotly.express as px
data_canada = px.data.gapminder().query("country == 'Canada'")
fig = px.bar(data_canada, x='year', y='pop')
fig.show()
Example 3: plotly vertical bar chart
import plotly.express as px
df = px.data.tips()
fig = px.bar(df, x="total_bill", y="day", orientation='h')
fig.show()