Extra space on after y axis and at the end of chart

Extra space is added to the left and right side of the chart,When the mode is “markers+lines”
When the mode is just “lines” it is working fine no extra space is there.


Any idea how this can be fixed?


Simply set xaxis.range or yaxis.range

See https://github.com/plotly/plotly.js/issues/1775 for more info

Or subscribe to https://github.com/plotly/plotly.js/issues/1876 for news on potential improvements.

I had the same problem, I got it working by adding this range: [0,x.length-1], that works fine assuming that the x labels are unique


if use range to control this, the final output would be weird when the range slider is used.

1 Like