Black Lives Matter. Please consider donating to Black Girls Code today.

Y-Axis Defaults To 0 On Time Series Scatter?

I’m working on a timeseries scatterplot that shows numerical values for 50 traces that change for each year. The traces range from 500k to 120M.

For some reason, the graph displays the -1 part of the y-axis and doesn’t give a clear picture of where the 50 points are at over the course of the years.

Even though all of them have a matching x value pair with the years, when I had them all in it caused weird issues. So I’m just using one x array to signify the years (it’s the same x values for all of the traces).

Here’s the code I’m using:

It’s a little hard to help you out here as we don’t access to your data arrays.

I suspect your x and/or y don’t have the proper dimensions. Make sure that both the x and y arrays or 1D [ /* ... */ ] and that should solve it.

Are you able to elaborate on “proper dimensions”? These same arrays have been used for numerous other visualizations — including line, choropleth and bar — with no issue.

like this:

trace = {
  x: [1,2,3],
  y: [2,1,2]
}

not

trace: {
  x: 1,
  y: [1,2,3]
}

like I suspect you’re doing.