I have a data set on the form of 3 spatial coordinates x,y,z
and an amplitude, here is a small crop of the data:
[ 0 2.9373 0.4646 2.9926
0.8384 1.5338 1.0000 1.0016
0 0.7619 0.5051 1.0033
1.0000 3.5288 0.6667 2.9894
0 0.5013 0.4343 1.0037
1.0000 2.8070 0.4848 2.9935
0.7980 4.0000 0.8586 2.9872
1.0000 0.1404 0.0707 1.0043
1.0000 1.7845 0.1818 1.0007
0.9798 3.1679 1.0000 2.9913]
What I would like is a 2D contour plot, where the interface is represented by the contour levels within, say, 2.0 +/- 0.05.
First I start by making the data 2D and thus choose the values z
within +/- 0.01. Then I am only left with x,y,amplitude
.
Then I used this for extracting the data sets that satisfy data(:,4)
is within 2.0 +/- 0.05.
However, what remains now is actually making the contour plot. I tried contour
but that requires the data to have a format of meshgrid
, which it does not. So my question is, what is the easiest way to make a contour plot of the extracted data?