【发布时间】:2020-07-22 15:10:11
【问题描述】:
在plotly.figure_factory.create_choropleth 中使用对数刻度颜色编码时,在颜色代码图例中显示actual 值的最佳方式是什么?
这里是示例代码:
import plotly.figure_factory as ff
fips = df['fips']
values = np.log10(df['values'])
endpts = list(np.linspace(0, 4, len(colorscale) - 1))
fig = ff.create_choropleth(fips=fips, values=values, scope = ['usa'], binning_endpoints = endpts)
这是我目前拥有的:
这是我想要的:
与上图完全相同,只是图例中显示的是实际数字而不是 log10(values)。例如,而不是 0.0-0.5 和 0.5-1.0(意思是 10^0 到 10^1/2 和 10^1/2 到 10^1)我想看到:1-3、4 -10 等等。
【问题讨论】:
-
你能给我一份 MWE 吗?
标签: python plot colors plotly legend