I’m plotting a simple line chart using the following code:
fig = px.line(day_pnl, x = "Date", y = "Pnl", color = "Name")
fig.update_layout(xaxis_type='category')
fig.update_traces(mode='markers+lines')
The result of this looks like this:
I don’t know why I’m getting this extra space on the left and right outside the max dates in the plot. The result is the exact same if I add:
fig.update_layout(xaxis_range = [ day_pnl.Date.min(), day_pnl.Date.max()])
after the above 3 lines. I can’t figure out why this space is being included or how to remove it.