How do I put the patch in the correct position?
3 views (last 30 days)
I have a longitude(x), latitude(y), altitude(z) data, which is aircraft data.
I made a patch using my data. but the patch is loacted in another position and y axis is not latitude number.
I don't know how to locate it in the correct position and how to use latitude(y) data for this.
so, I want the patch to be on trajectory like first image.
for i = 1:length(Dep_33L)
plot3(Dep_33L(i).Longitude, Dep_33L(i).Latitude, Dep_33L(i).BAlt)
yv = linspace(min(y), max(y), 30);
for k = 1:length(yv)
for i = 1:length(RKSI_Dep_33L)
x(i) = Dep_33L(i).Longitude(k);
z(i) = Dep_33L(i).BAlt(k);
xptcl = prctile(x,[2.5 97.5]);
zpctl = prctile(z,[2.5 97.5]);
xl(k,:) = xptcl;
zl(k,:) = zpctl;
patch([xptcl flip(xptcl)], [0 1 1 0]+yv(k), [[1 1]*zpctl(1) [1 1]*zpctl(2)], 'r', 'FaceAlpha',0.25)
plot3(xl(:,1), yv(:), zl(:,1), '-k', 'LineWidth',2)
plot3(xl(:,1), yv(:), zl(:,2), '-k', 'LineWidth',2)
plot3(xl(:,2), yv(:), zl(:,1), '-k', 'LineWidth',2)
plot3(xl(:,2), yv(:), zl(:,2), '-k', 'LineWidth',2)
Star Strider on 27 May 2022
It appears that the ‘x’ and ‘y’ axes are reversed with respect to the data and the percentile patches. Keep the percentile patches as they are, and experiment with changing the data plot arguments so that they overlap correctly. (Without the axis labels and the axis gridlines, it is difficult to determine what needs to be changed.)