【问题标题】:bokeh 0.12.10 not rendering Segments on GMapPlot散景 0.12.10 不在 GMapPlot 上渲染分段
【发布时间】:2018-09-13 04:29:46
【问题描述】:

我正在尝试使用 GMapPlot 在地图上显示线段。在 jupyter notebook 中,线条以红色闪烁然后消失。这是我的代码(省略了一些小数):

map_options = GMapOptions(lat=37.88, lng=-122.23, map_type="roadmap", zoom=10)
plot = GMapPlot( 
  x_range=DataRange1d(), y_range=DataRange1d(), map_options=map_options
)
source = ColumnDataSource( data = dict(
    y=[ 37.762260 ],
    x=[-121.96226],
    ym01=[37.762290 ],
    xm01=[-121.96189 ]
)

segment = Segment(x0="x", y0="y", x1="xm01", y1="ym01",line_color="green", line_width=100)
plot.add_glyph(source, segment)
plot.add_tools(PanTool(), WheelZoomTool(), BoxSelectTool())
output_notebook()
show(plot)

【问题讨论】:

    标签: jupyter-notebook bokeh


    【解决方案1】:

    更新此问题已在 https://github.com/bokeh/bokeh/pull/8240 中得到解决,这将成为 Bokeh 1.0 的一部分



    我尝试使用更新的代码进行重现:

    from bokeh.io import show
    from bokeh.models import GMapOptions, ColumnDataSource
    from bokeh.plotting import figure, gmap
    
    map_options = GMapOptions(lat=37.88, lng=-122.23, map_type="roadmap", zoom=10)
    plot = gmap(google_api_key=API_KEY, map_options=map_options)
    
    source = ColumnDataSource( data = dict(
        y=[ 37.762260 ],
        x=[-121.96226],
        ym01=[37.762290 ],
        xm01=[-121.96189 ]
    ))
    
    plot.segment(x0="x", y0="y", x1="xm01", y1="ym01",line_color="green", line_width=10, source=source)
    
    show(plot)
    

    并且可以确认该段没有显示。稍微改变以显示圆圈确实有效,所以我不得不得出结论,这是某种错误。请提交详细的GitHub issue to report this bug

    【讨论】:

      猜你喜欢
      • 2018-11-16
      • 1970-01-01
      • 1970-01-01
      • 2017-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-19
      • 1970-01-01
      相关资源
      最近更新 更多