R: Plotly 3d contour 3 arrays with different x and y lengths

I have been trying to plot my time-frequency (spectrum) data with x (512) and y (1752) and z (512x1752). However, it seems like Plotly only accepts square-shaped data (x=y). This is my code for the plot - my x, y and z are in different arrays:

x <- FrequencyData #512
y <- TimeData #1752
z <- IntensityData #512x1752

p <- plot_ly(x=~x, y=~y , z=~z, type = ‘contour’) %>%
layout(title = ‘Test 11: Contour plot of the sensor’,
yaxis = list(title=""),
xaxis = list(title=“Frequency (kHz)”))

This is the error that I get:
“Error: Variables must be length 1 or 1752.
Problem variables: ‘x’”

Any suggestions?