Boxplot with time xaxis plotting y as categorical

I’m trying to make a box plot with the following arrays

y = array([[16.2, 16.2, 16.2, ..., 15.9, 16.5, 15.5],
            ...,
           [13.8, 14.8, 12.9, ..., 13.3, 16.1, 13.3]])
> y.shape = (110, 40)


x = array(['2023-08-03T08:00:00.000000000', '2023-08-03T09:00:00.000000000',
            ...
           '2023-08-07T20:00:00.000000000', '2023-08-07T21:00:00.000000000'],
      dtype='datetime64[ns]')
> x.shape = (110,)

When doing the boxplot

go.Figure(go.Box(
    y=y,
    x=x,
    name=col,
))

The y axis is interpreted as categorical

I’ve checked that y has the correct numerical type and x is a datetime.

What am I doing wrong?

HI @guidocioni,

could you provide a MRE?

Hey, thanks for the reply.

I’m trying to structure a MRE but I haven’t had the time yet.

I think the problem stems from the fact that plotly does not interpret correctly the array N x M that I’m passing as y. I was under the impression that the default behaviour would be as in matplotlib: you pass a N array as x, an N x M array as y, and M boxplots will be constructed at N locations defined by x.

This is what I want to achieve (in matplotlib, forget about the grey line)

Is there any way to reproduce this in plotly with the arrays in the shape I have?