question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support MultiLineString in plotly.graph_objs.Scattermapbox

See original GitHub issue

When plotting multiple lines on a MapBox map, there are two options:

  • Make an array of plotly.graph_objs.Data for every new line. Benefits: Each line has separate options for hover, compatible with NaNs in the data. Drawbacks: Does not scale, each line seems to be on a new map layer that needs to be loaded separately; thus very slow for large numbers of lines.
  • Make one entry in plotly.graph_objs.Data, and pepper the data with NaNs. With connectgaps = False (default, I think) no line will be drawn across the NaNs, thus splitting the lines. Benefit: Scales well, all lines are on one layer. Drawbacks: No option to connect NaNs that may naturally occur in the data. Shared options like coloring or hover-information for all lines.

It would be nice to be able to draw multiple lines on one map layer without resorting to hacks. Bonus for allowing separate options for lines on the same map layer.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
OleMussmanncommented, Jul 9, 2018

@alexcjohnson That would be great, thanks a lot! Please let me know if you need help testing a version, or if you need sample code with which you can experience the performance drop.

0reactions
russ-schumachercommented, May 16, 2020

sorry to raise an old thread, but is there an example of a solution to this issue somewhere? I’m having the same problem, where plotting many lines using scattergeo works fine, but using mapbox is extremely slow. thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

plotly.graph_objects.Scattermapbox — 5.11.0 documentation
The data visualized as scatter point, lines or marker symbols on a Mapbox GL geographic map is provided by longitude/latitude pairs in lon...
Read more >
How to plot a scattermapbox with pandas?
I'm trying to plot lat/lon points on a scattermapbox with a ... type: MultiLineString in my geojson and not Polygon or Multipolygon?)
Read more >
Lines on mapbox in Python - Plotly
Lines on Mapbox maps from GeoPandas¶. Given a GeoPandas geo-data frame with linestring or multilinestring features, one can extra point data and use...
Read more >
Lines on maps in Python - Plotly
Below we show how to create geographical line plots using either Plotly Express with ... Given a GeoPandas geo-data frame with linestring or...
Read more >
plotly.graph_objects.Figure — 5.11.0 documentation
Supported dict properties: activeselection. plotly.graph_objects.layout.Activeselec tion instance or dict with compatible properties. activeshape.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found