✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Conditionally change the color of one bar in a bar graph

I would want a bar graph that would change the color of the bars correspondingly to the value of a threshold. Below is what I currently have. However, i would want the bar to entirely orange (now, it has a skinny blue line). Is there a way to do it? Thanks!

graph_org

My code:

pval_thresh = 0.05
df[‘color’] = np.where(df[‘pval’] >= pval_thresh, ‘#195695’, ‘#f3981e’)
df.sort_values(by=[‘rate’], ascending=True, inplace=True)

if (df[‘pval’].min() <= pval_thresh):
annotations_dict = dict(
x=0.8,
y=6,
xref=‘x’,
yref=‘y’,
text=’ There is a significant difference ‘,
showarrow=False,
font=dict(
family=‘Helvetica’,
size=12,
color=’#000000
),
align=‘center’,
bordercolor=’#F3981E’,
borderwidth=1,
borderpad=10,
bgcolor=’#f3981e’,
# opacity=0.9,
)
else:
annotations_dict = dict(
x=0.8,
y=6,
xref=‘x’,
yref=‘y’,
text=’ No significant difference’,
showarrow=False,
font=dict(
family=‘Helvetica’,
size=12,
color=’#ffffff
),
align=‘center’,
borderwidth=1,
borderpad=10,
bordercolor=’#195695’,
bgcolor=’#195695’,
opacity=0.9,
)