Plotly Map Copyright Notice Box Location

This may be more of a Holoviz Panel question - but I am not quite sure.

When rendering a Plotly map (eg. px.scatter_map) in Panel , the copyright notice that shows up automatically in maps with tiles sourced from eg. OpenStreetMap is rendered below the actual figure:

import panel as pn
import pandas as pd
import plotly.express as px

pn.extension("plotly")
# 
fig = px.scatter_map(
    lat=[],
    lon=[],
    zoom=0,
    height=300
)
fig.update_layout(map_style="open-street-map")
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})

plotly_pane = pn.Column(
     pn.pane.Plotly(fig),
    '# Some Caption',
)
plotly_pane.servable()

It then overlaps with other elements:

Is there a way to define the location of this map element (maplibregl-ctrl-attrib-button)?

Related issue on the Panel repo.

I have a similar issue, itโ€™s not configured properly.

@TheMichael
Iโ€™m not able to reproduce the issue you reported with the following code:

import plotly.express as px

fig = px.scatter_map(
    lat=[],
    lon=[],
    zoom=0,
    height=300
)
fig.update_layout(map_style="open-street-map")
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})

fig.show()

@mayaradaher can you please share the code that you used to see if I can reproduce the error locally?

@adamschroeder, indeed the malformed copyright notice only appears if I render the map through Panel. Is there a way to specify the location etc. of this notice element by passing a parameter to the px.scatter_map function? Perhaps this would then also solve the Panel-related issue?

Hi @TheMichael
I donโ€™t think px.scatter_map has an attribute to specify locations of notices. But just in case, hereโ€™s the full list of attributes. Hereโ€™s the px list for scatter_map.

Hi @adamschroeder

My code is here: GitHub - mayaradaher/michelin-app: Michelin World Guide app
And app here: https://michelinrestaurants-122629525979.southamerica-east1.run.app/en

This should be fixed in a Panel release next week.

1 Like