Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable grid lines for Holoview Curve

When I display Holoview plot there are no gridlines. I am struggling to find out how to switch them on.

Graph without gridlines

Code snippets:

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
like image 204
Douglas Macdonald Avatar asked Nov 02 '25 09:11

Douglas Macdonald


1 Answers

I solved the problem. show_grid=True required.

    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))
like image 127
Douglas Macdonald Avatar answered Nov 03 '25 23:11

Douglas Macdonald