Closed as not planned
Description
Hi, I would like to see projection support in Mapbox map layers like, px.scatter_mapbox
, such as 'globe' projection (which will make a tile-based 3d globe map). I noticed that Plotly is integrated with Mapbox-gl, and the Mapbox-GL support different projections, so it should be easy to have this option in Plotly. It looks like it's already supported in scatter_geo
(see the doc)but not Mapbox layers.
See projections support in Mapbox-GL here. See what's looks like with projection here,
The code by the support the function should look like,
import pandas as pd
us_cities = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv")
import plotly.express as px
fig = px.scatter_mapbox(us_cities, lat="lat", lon="lon", hover_name="City", hover_data=["State", "Population"],
color_discrete_sequence=["fuchsia"], zoom=3, height=300)
fig.update_layout(
mapbox_style="white-bg",
mapbox_layers=[
{
"below": 'traces',
"sourcetype": "raster",
"sourceattribution": "United States Geological Survey",
"source": [
"https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}"
]
}
])
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0}, projection= 'globe')
fig.show()
the projection
option can be configured to support more projections
Metadata
Metadata
Assignees
Labels
No labels