Multiple bar graphs on one page plot.ly express

Hello I am new to plot.ly. I want to graph multiple bar graphs on one page, all with titles and axes, and I want the hex color of the bar graphs to be #7AB547. What I have so far:

import plotly.express as px
import plotly.offline as pyo
import plotly.graph_objs as go
for template in [‘plotly_dark’]:
fig = px.bar(df, y=‘yy’, x=‘xx’, template=template, title=“xx vs xx”)
fig.show()

Hi @zero, welcome to the plotly community :wink:

you can set the use the color_discrete_sequence parameter of the px.bar function to set the default color.

Here a generic example:

import plotly.express as px
import pandas as pd

df = px.data.gapminder()
df1 = df[df['country'].isin(['Canada', 'Germany'])]
fig = px.bar(df1, x='year', y='pop',color_discrete_sequence=['#7AB547'], facet_col='country')
fig.show()


hope this helps

Alex-

1 Like