Black Lives Matter. Please consider donating to Black Girls Code today.

Line plot filling with shape 'hv'

Hello everyone, first of all thanks for all the great work loving the ecosystem!

I have come across some inconsistent behaviour when trying to fill a line graph. I am trying to see when an event happens so I am coloring to ‘tozeroy’ and using the shape of the line as ‘hv’ to give the sharp on/off behaviour. When I zoom in on the graph I can see that only the interior of my graph is colored as expected however in the default zoomed out view I get some sort of stair stepped behaviour, see attached images.

I am using plotly 2.6.0.

Cheers,

import plotly.graph_objs as go
from plotly.offline import init_notebook_mode, iplot

init_notebook_mode()

times = ['2013-04-05 14:37:31.660000', '2013-04-05 14:37:42.093000',
               '2018-01-17 15:50:29.994000', '2018-01-17 15:50:32.429000',
               '2018-01-17 15:50:32.433000', '2018-01-17 15:50:32.434000',
               '2018-01-17 15:50:32.437000', '2018-01-17 15:50:32.441000',
               '2018-01-17 15:50:32.447000', '2018-01-17 15:50:32.472000',
               '2018-01-17 15:50:33.152000', '2018-01-17 15:50:33.253000',
               '2018-01-17 15:50:33.260000', '2018-01-17 15:50:33.469000',
               '2018-01-17 15:50:33.589000', '2018-01-17 15:50:33.619000',
               '2018-01-17 15:50:33.666000', '2018-01-17 15:50:33.929000',
               '2018-01-17 15:51:02.245000', '2018-01-17 15:51:06.216000',
               '2018-01-17 15:52:36.662000', '2018-01-17 15:53:01.143000',
               '2018-01-17 15:53:35.691000', '2018-01-17 15:53:48.111000',
               '2018-01-17 15:53:50.384000', '2018-01-17 15:53:51.972000',
               '2018-01-17 15:53:52.101000', '2018-01-17 15:53:52.280000',
               '2018-01-17 15:53:53.902000', '2018-01-17 15:53:55.112000',
               '2018-01-17 15:53:55.880000', '2018-01-17 15:53:56.296000',
               '2018-01-17 15:53:57.068000', '2018-01-17 15:53:58.329000',
               '2018-01-17 15:53:58.612000', '2018-01-17 15:53:58.666000',
               '2018-01-17 15:53:59.625000', '2018-01-17 15:54:00.422000',
               '2018-01-17 15:54:00.919000', '2018-01-17 15:54:02.347000',
               '2018-01-17 15:54:02.679000', '2018-01-17 15:54:06.715000',
               '2018-01-17 15:55:37.752000', '2018-01-17 18:07:25.560000',
               '2018-01-17 18:08:10.421000', '2018-01-17 18:08:10.451000',
               '2018-01-17 18:08:19.855000', '2018-01-17 18:08:27.388000',
               '2018-01-17 18:08:33.801000', '2018-01-17 18:08:53.831000',
               '2018-01-17 18:08:56.931000', '2018-01-17 18:09:04.399000',
               '2018-01-17 18:09:07.654000', '2018-01-17 18:10:22.277000',
               '2018-01-17 18:13:10.988000', '2018-01-17 18:15:59.751000',
               '2018-01-17 18:29:28.355000', '2018-01-18 09:10:48.440000',
               '2018-01-18 09:10:48.447000', '2018-01-18 09:10:48.456000',
               '2018-01-18 09:10:48.466000', '2018-01-18 09:29:14.894000',
               '2018-01-18 09:29:21.560000', '2018-01-18 09:32:54.324000',
               '2018-01-18 09:37:49.551000', '2018-01-18 10:00:58.762000',
               '2018-01-18 10:03:41.302000', '2018-01-18 10:06:27.101000',
               '2018-01-18 10:12:25.628000', '2018-01-18 10:13:36.824000',
               '2018-01-18 10:18:25.165000', '2018-01-18 10:31:57.689000']

values = [0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0]

dff = pd.DataFrame(numpy.array([times, values]).T, columns=['times', 'values'])
dff['times'] = pd.to_datetime(dff['times'])

trace = go.Scatter(
    x = dff['times'],
    y = dff['values'],
    fill='tozeroy',
    line = dict(
        shape='hv',
    ),
)

iplot([trace])```


![image|690x128](upload://npYQngaslurCO8ucQitrjAgnUi6.png)

![image|690x117](upload://pl0vmBpCN6geeEdwEoZjgFJd95B.png)