How to specify the x coordinate on a grouped bar chart on plotly?

I made a bar chart with python plotly, and I want to put a marker on a particular bar, example non-smoking females. Does anyone know how to specify this?

I took an example from the plotly documentation, if I try to put the marker it just takes the center of the main category.

import as px
df =
fig = px.histogram(df, x="sex", y="total_bill",
             color='smoker', barmode='group',

#trying to set the marker

Hi @Montes-JMa,

I found this thread - scattermode = group · Issue #4913 · plotly/plotly.js · GitHub where a workaround with go.Box is posted.
Maybe this could help.

Thank you so much.

I actually solved it with a second axis. I leave the link in case someone else has this problem.