我目前正在使用plotly
上的 colored颜色 条来指示放置水下声纳接收器的深度.目前, colored颜色 栏如下所示:
然而,我认为如果较大的数值应该放在底部,而较小的数值应该放在顶部(即设备被放置在离地面更近的地方),这会更有意义,但不知道如何做到这一点.
我用来创建图形和 colored颜色 栏的代码由两个字典组成(一个指定数据,另一个指定布局).
import plotly.offline as off
import _tkinter
from matplotlib import pyplot as plt
from matplotlib import ticker
from matplotlib.dates import drange
...
data = [
dict(
lat = lat_array,
lon = lon_array,
marker = dict(
color = log_depth_array,
size = 6,
colorbar = dict(
title = 'Log Depth',
thickness = 10,
titleside = "right",
outlinecolor = "rgba(68, 68, 68, 0)",
ticks = "outside",
ticklen = 3,
showticksuffix = "last",
ticksuffix = " log(meters, 10)",
dtick = .1
),
),
mode = 'markers',
text = mouseover_text,
type = 'scattergeo'
) ]
layout = dict(
geo = dict(
showframe = True,
framewidth = 25,
scope = 'north america',
showland = True,
landcolor = "rgb(212, 212, 212)",
showocean = True,
oceancolor = "rgb(200, 255, 255)",
subunitcolor = "rgb(0,0,0)",
resolution = 50,
projection = dict(
type = 'robinson',
rotation = dict(
lon = -100
)
),
lonaxis = dict(
showgrid = True,
gridwidth = 0.5,
range= [ lon_min-.4, lon_max+.4 ],
dtick = 5
),
lataxis = dict (
showgrid = True,
gridwidth = 0.5,
range= [ lat_min-.4, lat_max+.4 ],
dtick = 5
)
),
)
fig = { 'data':data, 'layout':layout }
off.iplot(fig)
我应该添加什么参数(可能是添加到数据字典中的Colorbar字典中),才能使代表更大深度的数字位于Colorbar的底部?