Plotly: How to remove empty dates from x axis?

后端 未结 2 1017
抹茶落季
抹茶落季 2020-12-19 14:36

I have a Dataframe

   Date        Category    Sum
0  2019-06-03    \"25M\"      34
1  2019-06-03    \"25M\"      60
2  2019-06-03    \"50M\"      23         


        
2条回答
  •  一生所求
    2020-12-19 14:50

    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.

提交回复
热议问题