2017-10-12 60 views
0

当我显示Holoview图时,没有网格线。我正在努力找出如何开启它们。如何启用Holoview曲线的网格线

Graph without gridlines

代码片段:

renderer = hv.renderer('bokeh').instance(mode='server') 



    plot = hv.Curve(
    data 
    , kdims=['observation_time'] 
    , vdims=vdims 
    , extents=(pd.datetime(year=2000, month=1, day=1, hour=0, minute=0, second=0), None, pd.datetime(year=2000, month=1, day=1+days, hour=0, minute=0, second=0), None) 
    , label=vdims_str + " " 
    )(plot=dict(width=WIDTH)) 

... 

plot1 = _get_curve(date_index=date_index, vdims_str='total_a') 
plot2 = _get_curve(date_index=date_index, vdims_str='total_b') 
plot3 = _get_curve(date_index=date_index, vdims_str='total_c') 

plots = plot1 * plot2 * plot3 

回答

2

我解决了这个问题。需要show_grid=True

plot = hv.Curve(
    data 
    , kdims=['observation_time'] 
    , vdims=vdims 
    , extents=(pd.datetime(year=2000, month=1, day=1, hour=0, minute=0, second=0), None, pd.datetime(year=2000, month=1, day=1+days, hour=0, minute=0, second=0), None) 
    , label=vdims_str + " " 
    )(plot=dict(width=WIDTH, show_grid=True))