
How to make the following contour plot in matlab?
1 view (last 30 days)
Show older comments
Hi,
I want to make a contour plot looking similar to the one in the attached figure.In the figure, the contour is overlaid on the specimen by default by the software where the test was done.I have x,y co-ordinates of the pixels of the colored area as well as the value which the colors represents.
How can this be done separetely in matlab by importing the data?
The data is also attached.
0 Comments
Answers (2)
Cris LaPierre
on 16 Mar 2020
Edited: Cris LaPierre
on 16 Mar 2020
Try something like this.
data = readtable("Input1.xlsx","ReadVariableNames",false);
X = reshape(data.Var1,12,30);
Y = reshape(data.Var2,12,30);
Z = reshape(data.Var3,12,30);
contourf(X,Y,Z);
axis equal

0 Comments
darova
on 16 Mar 2020
Here is a shot
I = imread('forest.tif');
[m,n] = size(I);
[X,Y] = meshgrid( linspace(1,n/2,20), linspace(1,m,20) );
X = X+n/4;
imshow(I)
hold on
h = surf(X,Y,X*0,...
'edgecolor','none',...
'faceAlpha',0.5,...
'cdata',X-Y);
hold off
view(2)
colormap default
0 Comments
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!