Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
374 views
in Technique[技术] by (71.8m points)

python - How to make plotly.express.line lines not to connect between one another?

I am new to plotly and I am trying to draw some roads on a map in different colors based on the traffic value.

This is what I tried:

fig = px.line_mapbox(lat=test_lat, lon=test_long, hover_name=test_name,mapbox_style = 'carto-positron',color =test_trafic)
fig.show()

Where test_lat is an array with latitudes points, test_long is an array with longitudes, test_name are the names of the streets and test_trafic are the values of traffic.

The problem is that, when I run it, although the streets appear correctly on the map, plotly connects all the lines between them like this:

enter image description here

Is there a way to fix this?

question from:https://stackoverflow.com/questions/65598624/how-to-make-plotly-express-line-lines-not-to-connect-between-one-another

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...