フィルターのクリア

Surface plot with custom data tip

4 ビュー (過去 30 日間)
Pedro Augusto de Castro e Castro
Pedro Augusto de Castro e Castro 2020 年 4 月 20 日
回答済み: darova 2020 年 4 月 23 日
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:
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?

回答 (1 件)

darova
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)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by