[X,Y,Z] = meshgrid(-2:2);
V = X.*exp(-X.^2-Y.^2-Z.^2);
xslice = 0.8;
yslice = [];
zslice = [];
slice(X,Y,Z,V,xslice,yslice,zslice,'nearest')
fig2plotly(gcf, 'offline', false);
Also, as seen, the expected plot is a 4x4 surface. That grid division isn't happening in Plotly.
When specifying the interpolation method using the
methodinput argument, wheremethodcan be 'linear' (the default), 'cubic', or 'nearest', such interpolation method isn't being applied.Expected and generated (https://chart-studio.plotly.com/~xarico10/1043/#/) plots:


Also, as seen, the expected plot is a 4x4 surface. That grid division isn't happening in Plotly.
Examples on using
methodcan be found on:https://www.mathworks.com/help/matlab/ref/slice.html#mw_e6993c56-f881-47e4-a291-fff253172919