Drawing contour plot under surface using MATLAB's surfc function and Plotly!

With MATLAB we can create a 3-D surface plot with a contour plot underneath. For this MATLAB has reserved the function surfc(X,Y,Z). The figure generated by MATLAB is really captivating. In this post we will see what the equivalent version created by Plotly using fig2plotly looks like. I can tell you that it is something exquisite :yum:

To achieve this with fig2plotly, we again need to resort to the optional 'TreatAs' parameter, setting it to 'surfc'. Let’s see how this would be with an example

[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);

sc = surfc(X,Y,Z);
sc(1).EdgeColor = 'yellow';

fig2plotly(gcf, 'offline', false,  'TreatAs', 'surfc');

After we run the MATLAB code above, the results we would get looks like this

As I mentioned before, MATLAB version (on the left) is compelling. But Plotly version (on the right) is really sweet

If you want to experience this on your own at Plotly Chart-Studio, please follow this link. I am inviting you to what you are doing. You will not regret! :heart_eyes:

In this repository folder you can find more examples using MATLAB’s surfc functionality. Please feel free to recreate those examples with fig2plotly using what is explained in this post :call_me_hand:

Attached below more results that I obtained from my side :upside_down_face: