フィルターのクリア

How to generate surface from scatter3 with xyz coordinates and specified color

33 ビュー (過去 30 日間)
bsriv
bsriv 2022 年 10 月 24 日
回答済み: Matt J 2022 年 10 月 24 日
Hi, I have generated a 3D scatter plot using scatter3 with XYZ coordinates (all column vectors) and a separate color column vector
>> figure;scatter3(tbl.pred1,tbl.pred2,tbl.pred3,200,tbl.dv,'filled');color=colorbar;color.Label.String='DV';colormap jet;hold on;xlabel('predictor 1');ylabel('predictor 2');zlabel('predictor 3');set(gca,'FontSize',20);
Which produces an expected 3d scatter plot:
I would like to turn this into a 3d surface but I'm stuck on how. Would very much appreciate any guidance. Thank you!

回答 (1 件)

Matt J
Matt J 2022 年 10 月 24 日
Perhaps as follows,
[x,y,z]=deal(tbl.pred1,tbl.pred2,tbl.pred3);
T = delaunay(x,y);
trisurf(T,x,y,z)

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by