How to create isocurves with given values in coordinates?
23 views (last 30 days)
Show older comments
Philippe Corner
on 30 Jul 2018
Answered: Star Strider
on 30 Jul 2018
If we have a matrix which contains 3 columns of X coordinate, Y coordinate and assigned values to those coordinates respectively, how could be create a plot with isocurves similar to contour function in matlab?
m=[342854 657145 32
342996 657287 12
343137 657428 12
342359 657075 34
342501 657216 26
342642 657357 41
342784 657499 12
342925 657640 34
342006 657145 56
342147 657287 32
342289 657428 24
342430 657570 53
342571 657711 23
342713 657852 23
341935 657499 24
342076 657640 43
342218 657782 45
342359 657923 3
342501 658065 45
341723 657711 3
341864 657852 52
342006 657994 12
342147 658135 23
342289 658277 54
341511 657923 32
341652 658065 14
341794 658206 18
341935 658347 43
342076 658489 22
341299 658135 6
341440 658277 75
341582 658418 33
341723 658560 23
341864 658701 12
341228 658489 43
341369 658630 34
341511 658772 52
341652 658913 41
341016 658701 3
341157 658842 15
341299 658984 19
341440 659125 32];
X=m(:,1);
Y=m(:,2);
Value=m(:,3);
0 Comments
Accepted Answer
Star Strider
on 30 Jul 2018
One approach:
figure
stem3(X, Y, Value) % Exploratory Plot To View Data
grid on
[Xm,Ym] = ndgrid(X,Y); % Create Matrices
Vm = griddata(X, Y, Value, Xm, Ym); % Interpolate Grid
figure
contour3(Xm, Ym, Vm)
grid on
I used contour3 here to demonstrate the problems. Experiment with surfc and contour.
Your data do not easily lend themselves to a contour plot. You will need to work with your data a bit to get a better representation.
0 Comments
More Answers (0)
See Also
Categories
Find more on Surface and Mesh 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!