Hello, I’m currently using plotly 4.9 and I’m facing the same issue with the lenght mismatch error.
However, on my side this error only occurs when column names are floats.
Indeed, after reading the @nicolaskruchten commentary about some of the items of ‘var_plotting’ not in the data frame column names, I tried both to change my column names with integers or string (simply using [str(i) for i in mydf.columns] when it was full of floats) and it worked! (see code below)
mydf = pd.DataFrame(np.zeros((10,3)))
mydf.columns = [1,2,3] #works
mydf.columns = [0.5,1.5,2.5] #doesn't work
mydf.columns = [round(i,1) for i in [0.5,1.5,2.5]] #doesn't work
mydf.columns = [str(i) for i in [0.5,1.5,2.5]] #works
fig = px.scatter(mydf, x=mydf.index, y=mydf.columns)
As it only failed for floats I guessed it was because of accuracy mismatches.
Would you have another solution than passing the equivalent string for floats?