Surface plot with custom data tip
4 ビュー (過去 30 日間)
古いコメントを表示
Hello,
So, I have 4 data vectors X Y Z and F. A little example is something like this:
X = 2.3573 2.3366 2.3123 2.2936
Y = 1.2322 1.1182 1.2204 1.2158
Z = 0.9870 0.9849 0.9871 0.9870
F = 9600 10560 11520 12480
I want to plot this in a 3d surface plot, and later be able to create a custom data tip showing the information of the X, Y, Z and also the F.
I was able to do it with scatter3:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/286084/image.png)
But I can't find a way to do a surface plot like this, and still be able to make a custom data tip.
Another question, can I use the same updatefcn for different figures, using a switch-case?
0 件のコメント
回答 (1 件)
darova
2020 年 4 月 23 日
Use griddata to interpolate your data
xx = linspace(min(X),max(X),20);
yy = linspace(min(Y),max(Y),20);
[X1,Y1] = meshgrid(xx,yy);
Z1 = griddata(X,Y,Z,X1,Y1);
F1 = griddata(X,Y,F,X1,Y1);
surf(X1,Y1,Z1,'cdata',F1)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!