How to plot contur in 3 D
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a result calculation and I want to make plot contur in 3 D. From the excel files attxhed I also plot in two dimension of FzWz vs Depth
What is the appropriate Matlab function to create contur in 3 D of FzWz vs Depth
I attach the data file about the data.
Thank you for your kind attention
2 commentaires
Akira Agata
le 31 Mar 2020
But, looking at you data, there are several sheets in Excel file, and each sheet contains ~20 data.
I don't think 20 data points is sufficient to make contour plot. Do you want to concatenate all the data ( = 20 x number of sheet) before making a contour?
Réponses (1)
Akira Agata
le 31 Mar 2020
OK. Then, how about the following?
% Read all the data in the Excel file
T = table();
for kk = 1:8
Ttmp = readtable('Contour.xlsx','Range','A:D','Sheet',kk);
T = [T; Ttmp];%#ok
end
% Interpolate the data
% **Note: Since there is duplicated data point, griddata returns Warning**
[xGrid, yGrid] = meshgrid(...
linspace(min(T.Fz),max(T.Fz),20),...
linspace(min(T.wz),max(T.wz),20));
zGrid = griddata(T.Fz,T.wz,T.Depth,xGrid,yGrid);
% Show the result
figure
contour3(xGrid,yGrid,zGrid)
hold on
scatter3(T.Fz,T.wz,T.Depth)
xlabel('Fz','FontSize',14)
ylabel('wz','FontSize',14)
zlabel('Depth','FontSize',14)
colorbar
ax = gca;
ax.View = [-80 40];
5 commentaires
Akira Agata
le 3 Avr 2020
Hi Akhmad-san,
Sorry, it's still not clear for me.
> I want to plot between Fz*Wz against Depth
That must be 2D plot. But the original question is "how to plot contour in 3D".
Also, the listing coordinat you provided in the previous comment is not sufficient to plot contour in 3D.
Could you explain more details on what parameters should be x,y and z, and how the desiered plot looks like.
Voir également
Catégories
En savoir plus sur Data Distribution Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!