I'm interested in masking all non-zero values in a plotly time series plot.

Is there a way to simply not include the zeroes when rendering the plot, and connect all data points greater than zero?

I tried limiting the range in the layout, but this did not change what was plotted:

import plotly.graph_objs as go
import plotly.plotly as py

data = [go.Scatter(

layout = go.Layout(
        range=[2, 15]))

fig = go.Figure(data=data, layout=layout)


Here is the general structure of my code as a Pandas dataframe:

import pandas as pd    

d = {'timeseries' : [801, 802, 803, 804, 805],
         'units_sold' : [0, 0, 1, 3, 0]}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.