首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Geoviews点:使用高和低选项更改色彩映射表

Geoviews点:使用高和低选项更改色彩映射表
EN

Stack Overflow用户
提问于 2018-03-06 23:17:53
回答 1查看 758关注 0票数 0

我最近查看了this question关于手动设置全息视图颜色条的限制,但在更改了我的一个vdim的范围后,它并没有改变颜色条的上限和下限。有没有办法直接为特定的vdim传递Bokeh LinearColorMapper (及其选项)?

代码语言:javascript
复制
opts = {'plot' : dict(width=width_val, height=height_val, tools=[hover_shipments],
                  size_index='po_qty', 
                  color_index='magnitude',
                  size_fn=(lambda x : x/100),
                  click_policy='hide', colorbar=True),
   'style': dict(cmap='Viridis', line_width=0.25, alpha=0.75, fill_alpha=0.75,
                muted_alpha=0.05)}

ds_time_store.to(gv.Points, 
                      kdims=['longitude_qty','latitude_qty'], 
                      vdims=['store_num', 
                             'city_nm', 
                             'po_qty', 
                             hv.Dimension('magnitude', range=(0, 50))], label='late').opts({'Points' : opts})
EN

回答 1

Stack Overflow用户

发布于 2018-05-31 21:39:51

在设置点之前,通过在我的数据集locality_ratings上调用redim(aggregate_rating=dict(range=(0, 5))),我能够根据我的评级将颜色栏的边界从0设置到5。

代码语言:javascript
复制
    points = locality_ratings.redim(aggregate_rating=dict(range=(0, 5))).to(gv.Points, ['longitude', 'latitude'], 
                ['aggregate_rating', 'votes', 'cuisine_count', 'average_cost_for_two', 'price_range', 'locality'])
    (gts.Wikipedia * points.options(width=700, height=600, 
                            tools=['hover', 'save', 'zoom_in', 'zoom_out', 'pan' , 'wheel_zoom'],
                            colorbar=True, toolbar='above', xaxis=None, yaxis=None,
                            size_index=3, color_index=2, size=3, cmap=bokeh.palettes.all_palettes['Dark2'][5])).redim(longitude="Longitude",
                                                                                            latitude="Latitude",
                                                                                            aggregate_rating='Rating', 
                                                                                            locality="Locality",
                                                                                           votes="Votes",
                                                                                           price_range="Price Range",
                                                                                           average_cost_for_two="Avg. Cost for 2 (R)",
                                                                                           cuisine_count="No. Cuisines"
                                                                                        )
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49134205

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档