Missing line in mode = 'lines'

Hi,

I am in python3 (jupyter on mac os) and I just got this weird issue, in my go.scatter plot โ€“ a piece of the line is missing

any idea on whatโ€™s going on?

Thanks for your help

connectgaps=True connects last with first data unfortunately

Paste your code and data, please. We can help you only seeing whatโ€™s wrong in your code, and data.

Sure,

here is how I am building the trace:

full_trace = []

full_trace.append(
    go.Scatter(
    x = my_df.temp_var,
    y = my_df.cases,
    mode = 'lines+markers',
#     connectgaps=True, ## not working properly! -- connecting last w/ first 
    name = 'VENEZUELA'
    )
)

and this is the subset of the dataset close to that gap

temp_var,cases
2017-01-08,6043
2017-01-15,8087
2016-12-18,4854
2016-12-25,3757
2017-01-01,3081

Did you sort the dataframe by date?

thanks โ€“ sorting the df fixed the issue

(however, I donโ€™t see why the plot should depend on the sorting of the df)

@grgr If you remember a math function, f:[a, b]-->R, is defined on an interval that is an ordered set, and to get its graph you are plotting the line passing through 2d points of coordinates (x, f(x)), with x in [a,b]. Python and other programming languages works with a discretized function, i.e. you evaluate that function at some arguments
a=x_0<x_1<....< x_n=b.
Your line is defined on a time interval, thatโ€™s why you should sort the dataframe by date.