I having a trouble in making my graph more clear and smooth in other words, make the locations with high value of Z be much more clear or distributed among the adjacent points soth that it can be obvious that at certain location we have high Z. a sample of my data is attached and the below is the code I'm using. the attached figure is what I'm really looking for to have. Thanks in advance
num = readtable("01)90.xlsx") ; % Take all the data under each variable name
x=num{1:1:end, contains(num.Properties.VariableNames, 'x')};y=num{1:1:end, contains(num.Properties.VariableNames, 'y')};z=num{1:1:end, contains(num.Properties.VariableNames, 'v')};% Convert the matrix to 1 column only (scalar)
x=x(:);y=y(:);z=z(:);% Delete rows that contain NaNs with reference to the variable z
i=1; [m,n]=size(x); while i<=m if isnan(z(i,1)) x(i,:)=[]; y(i,:)=[]; z(i,:)=[]; i=i-1; end i=i+1; [m,n]=size(x); endx0 = min(x) ; x1 = max(x) ; y0 = min(y) ; y1 = max(y) ; xi = linspace(x0,x1,100) ; yi = linspace(y0,y1,100) ; [X,Y] = meshgrid(xi,yi) ;Z = griddata(x,y,z,X,Y) ;% Get boundary coordinates
idx = boundary(x,y) ; xb = x(idx) ; yb = y(idx) ; % Get points lying inside the boundary
idx = inpolygon(X,Y,xb,yb) ;Z(~idx) = NaN ;f=pcolor(X,Y,Z);colorbarshading interp axis([-800 800 -800 800]);
Best Answer