Plotly Line Markers beginning on y-axis

hello!

I'm trying to plot a line graph with markers(mode='lines+markers'.

However, there is a gap between the first data point and the y-axis. Is it possible to have the line + marker beginning on the y-axis? (or is this a limitation of using markers)

I can plot a line graph without markers and the line begins at the y-axis(mode='lines').

This is to do with the axis properties, which you set with the layout function.

try

your_plot %>% 
  layout(yaxis = list(range = range(your_y_data)))

https://plotly.com/r/reference/

There are some other axis properties you can set, like autorange = FALSE but you'll have to try them to see if they work the way you want.

https://plotly.com/r/axes/#rangemode

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.