Plotly: How to remove empty dates from x axis?

I had the same problem with my graph. Just add the following to layout code:

xaxis=dict(type = "category")

Note: I have used import plotly.graph_objs as go
and NOT import plotly.express as px

This worked for me. Hope it helps you too.

Leave a Comment