【发布时间】:2022-10-24 22:10:41
【问题描述】:
我使用 plotly 在地图上绘制线轨迹。我添加了使用颜色的比例。刻度的数据范围是 0.... 30 000 之间的数字。 刻度显示为“5k”、“10k”、“15k”……而不是“5000”、“10000”、“15000”…… 如何将刻度格式更改为后者?
我的代码:
# Draw a plot of a ground track
import plotly.graph_objects as go
fig = go.Figure(go.Scattermapbox(
mode = "markers",
lon = data.Wgs84Longitude,
lat = data.Wgs84Latitude,
marker = {'size': 5,
'color':data.Wgs84Altitude,
'colorscale': 'viridis',
'opacity': 0.5,
'showscale': True,
'colorbar': dict(
title='Altitude / m',
thickness=20,
titleside='top',
outlinecolor='rgba(68,68,68,0)',
ticks='outside',
ticklen=3) }))
fig.update_layout(
title = "Ground Track",
title_x=0,
title_y=0.95,
width=800,
height=700,
margin ={'l':0,'t':50,'b':0,'r':0},
mapbox = {
'center': {'lon': 10, 'lat': 10},
'style': "stamen-terrain",
'center': {'lon': Lon, 'lat': Lat},
'zoom': 8})
fig.show()
谢谢你的帮助。数据
【问题讨论】:
标签: python-3.x plotly-python colorbar