Remove mapbox attribution icon (still acknowledged)

Dear all,

I’ve been trying for hours to dive into the source code of Plotly, but I can’t seem to find a way of removing the small icon at the bottom of a choropleth interactive map (icon which is converted to a small text after saving the map to a pdf/jpeg).

As you can see on the image below, I’m trying to remove the small text “© OpenStreetMap contributors”:

It is because the figure should be inserted in an academic paper, but obviously I acknowledge the fact that this map was created thanks to OSM in a section:

Finally, we would like to acknowledge that all maps presented in this work were generated using data from OpenStreetMap, an open data platform licensed under the Open Data Commons Open Database License (ODbL) by the OpenStreetMap Foundation (OSMF). We extend our gratitude to the OSMF community for their dedication in maintaining and curating this invaluable resource, which greatly facilitated our study.

Here is a small reproducible example:

import plotly.express as px
import geopandas as gpd

df = px.data.election()
geo_df = gpd.GeoDataFrame.from_features(
    px.data.election_geojson()["features"]
).merge(df, on="district").set_index("district")

fig = px.choropleth_mapbox(geo_df,
                           geojson=geo_df.geometry,
                           locations=geo_df.index,
                           color="Joly",
                           center={"lat": 45.5517, "lon": -73.7073},
                           mapbox_style="open-street-map",
                           zoom=8.5)
fig.show()

fig.write_image('image.jpeg'))

Looking for your help!

1 Like