在 Matlab 中连续显示离散数据的密度

Showing density of descret data continuesly in Matlab

我想在彩色图像中连续显示一组离散数据。我使用了下面的代码,但它显示了离散的彩色点而不是连续的彩色背景。

scatter(xm,ym,[],c/(max(c)),'filled','d')

如何连续地用颜色显示我的数据(每种颜色显示不同的密度)?谁能帮帮我?

例如,

 ym=[7.5;7.5;7.5;5;5;5;2.5;2.5;2.5]
 xm=[2.5;5;7.5;2.5;5;7.5;2.5;5;7.5]
 c=[30000;30092;30084;30090;3052;30070;30042;30064;30079;30074]

试试这个:

clear
ym=[7.5;7.5;7.5;5;5;5;2.5;2.5;2.5];
xm=[2.5;5;7.5;2.5;5;7.5;2.5;5;7.5];
c=[30000;30092;30084;30090;30052;30070;30042;30064;30079];
cm=c-min(c);

F = scatteredInterpolant(xm,ym,cm);
ti = 2.5:.1:7.5;
[qx,qy] = meshgrid(ti,ti);
qz = F(qx,qy);
figure(1)
mesh(qx,qy,qz,'EdgeColor','none','FaceColor','interp');
hold on;
plot3(xm,ym,cm,'o');
hold off
view(2)

奖金:

figure; contourf(qx,qy,qz,'ShowText','on')