How do I specify marker_line_width with plotly.express.choropleth_mapbox?

I’m using px.choropleth_mapbox to make a choropleth. i want to modify the border width of the shapes. i see this is possible with go.Choroplethmapbox… how can i accomplish the same with the px factory?

thanks,
w

You cannot specify it directly in the function but you can update the trace afterwards:

fig = px.choroplethmapbox(
    # ...
)
fig = fig.update_traces(
    marker_line_width=0
)
1 Like

thanks! this is fantastic :slight_smile:

what about opacity of the lines? realizing i also need this (mission creep, i know)

The only arguments for choroplethmapbox.marker.Line are color, colorsrc, width and widthsrc so you cannot set the opacity of the line. If that’s an important requirement for you you can open an issue on Github. This would probably need to come in plotly-js first.

1 Like