plotly.graph_objs.Scatter - prevent vertical line for single data-points

I have a scatter figure whose data-points are connected with a dashed line. However, if there are single data-points the line connects them vertically with the x-axis. How can I prevent this, i.e. to have no connecting line for single data-points while keeping the connecting line for adjacent data-points?

I have experimented with connectgaps=False and shape=‘linear’, but without success

Thanks for the report. This seems odd.

Could you share the x/y data coordinates (or better yet, a fully reproducible code snippet) you’re using to help us debug?