plotly.py
plotly.py copied to clipboard
Malaysia is shown in a wrong place on a map
I am visualizing some data with plotly.express.scatter_geo. Malaysian data is shown in a wrong place:
Actually, Malaysia resides on both islands:
...but the capital Kuala Lumpur is situated in north-western part, and this part is associated with MY on maps by people.
Code is the following:
import nbformat
import plotly.express as px
import pandas as pd
...
fig = px.scatter_geo(df_merged, locations="alpha_3", size="devices", hover_name="country")
print(fig.to_html())
Package version is plotly==4.11.0.
JSON map is world_110m.json.
What is df_merged here?
What is df_merged here?
df_merged is a pandas DataFrame containing data similar to the following:
+---------------+---------+
| alpha_3 | devices |
+---------------+---------+
| MYS | 2 |
+---------------+---------+
| ROU | 4 |
+---------------+---------+
I think this is because of the values in the dataset that you are using. Your source code is correct!
I know that my source code is correct :-) I believe that the library is showing Malaysia at a slightly wrong place.
@archmoj can you please check this against your recent work and see if it's still an issue?
This is also related to geo subplots not map & mapbox.
@ndrezn Please keep track of this ticket.
Closing in favor of https://github.com/plotly/plotly.js/issues/7334