How to plot contour on imagesc for three variables?

조회 수: 3 (최근 30일)
Wiqas Ahmad
Wiqas Ahmad 2022년 4월 11일
댓글: Wiqas Ahmad 2022년 4월 12일
I want to obtain the folllowing figure using the program mentioned below. The three variable red encircled can be placed as x,y,z-axis. How can I modify my program to get such like figure?
close all;
clear all;
clc;
%% ------------------------------Program-------------------------------------
EC = [0.0052 0.0078 0.0104 0.0130 0.0156 0.0182 0.0208 0.0234 0.0260 0.0286];
Reff =[4:1:20];
FOV=[1,2];
for i=1:length(FOV)
for j = 1:length(EC)
for k = 1:length(Reff)
I0= getsignal([num2str(j),'FOV_',num2str(FOV(i)),'mrad\out_resultsG_I0.dat']);
Q0= getsignal([num2str(j),'FOV_',num2str(FOV(i)),'mrad\out_resultsG_Q0.dat']);
I(:,j)= smooth(sum(I0,2));
Q(:,j)= smooth(sum(Q0,2));
if(i==1)
dep1(:,j)= (I(:,j)-Q(:,j))./(I(:,j)+Q(:,j));
plot(dep1(:,j),z,'LineWidth',1.5,'color',col(:,j));
end
if(i==2)
dep2(:,j)= (I(:,j)-Q(:,j))./(I(:,j)+Q(:,j));
plot(dep2(:,j),z,'LineWidth',1.5,'color',col(:,j));
end
imagesc(num2str(Reff(k)),num2str(EC(j)),depi(j,k).')
colorbar
end
end
end
figure('name','depolarization ratio')
hold on
contour(Reff,EC,depi')
hold on
imagesc(Reff,EC,depi')
colorbar

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2022년 4월 11일
Maybe it is enough for you to make this minor modification:
figure('name','depolarization ratio')
imagesc(Reff,EC,depi')
hold on
c_levels = (15:5:65)/1000; % Your contour-levels might be completely different
[c,h] = contour(Reff,EC,depi',c_levels,'k'); % make contours black - to not get the same colours as the imagesc-map
clabel(c,h)
colorbar
HTH

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by