Here is one way:
x = linspace(0,4,10); % x coordinate
y = linspace(0,8,10); %^y coordinate
[X,Y] = meshgrid(x,y); % meshgrid
Z = sin(X)+cos(Y); % Z data, the stresses for X-Y coordinates
c = Z(:); % colors for scatter plot, make it a vector since scatter plot expect vectors
% actual plot
scatter(X(:),Y(:),[],c )
axis([-1 5 -1 9])
Here is another using actual contour plot:
contourf(X,Y,Z)