Open ragul-n opened 1 year ago
@RenaudLN @nicolaskruchten Hi, since I see your contributions in PRs #2559 #2638, would it be possible to have a dekko here? We have been unable to figure out the root cause and haven't received any response on the Plotly community forum/Stack Overflow either.
@ragul-n you've got incorrect latitude and longitude values
This works
import pandas as pd
import plotly.figure_factory as ff
import plotly.express as px
df = pd.read_csv("sample_data.csv")
fig = ff.create_hexbin_mapbox(
data_frame=df.query("-90 <= latitude <= 90 & -180 <= longitude <= 180"), lat="latitude", lon="longitude", color='TOT_POPULA',
agg_func=np.sum, nx_hexagon=30,
opacity=0.7, labels={"color": "Population"},
show_original_data=False,
original_data_marker=dict(size=1, opacity=0.6, color="deeppink"),
min_count=1,
mapbox_style="carto-darkmatter",
)
fig.update_layout(margin=dict(b=0, t=0, l=0, r=0))
fig.show()
Getting the following error while creating Hexbins in Mapbox using Plotly figure factory.
Code:
Here is the dataset used above: sample_data.csv