Plot trajectory colorized according to the standard deviation
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a set of data (Latitude(x), Longitude(y)) and their standard deviation. I want to plot the X-Y trajectory but I need it to be colorized (like temperature distribution) according to the standard deviation of each point. This is the trajectory:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191276/image.png)
So I want the trajecory somehow colored according to the standard deviation like the following figure, this help me see the relation between the trajectory and the corresponding std at each point, I have tried with the errorbar function but that is not helping.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191277/image.png)
댓글 수: 0
답변 (2개)
KSSV
2018년 6월 15일
n = 100;
x = linspace(-10,10,n); y = x.^2;
z = zeros(size(x));
col = x; % This is the color, vary with x in this case.
surface([x;x],[y;y],[z;z],[col;col],...
'facecolor','no',...
'edgecolor','interp',...
'linewidth',2);
댓글 수: 0
Kaushik Lakshminarasimhan
2018년 6월 15일
편집: Kaushik Lakshminarasimhan
2018년 6월 15일
Plot your data as a surface with zero height.
x = vector_of_latitudes;
y = vector_of_longitudes;
z = zeros(size(x)); % surface has zero height
clr = vector_of_standard_deviations; % vector of colors
surface([x;x],[y;y],[z;z],[clr ;clr],'edgecol','interp');
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!