필터 지우기
필터 지우기

How to apply imagesc on the plot with two lines?

조회 수: 3 (최근 30일)
Wasp Hamberg
Wasp Hamberg 2020년 4월 5일
답변: Image Analyst 2020년 4월 5일
I need to paint my plot 1 like this 2, but do not how can I do that. When the curve touches a red line that part of curve becomes red [total amplitude becomes bigger in the area of the envelope] 3. Colors (and colorbar) should show a changing of the amplitude. As I understand, color is changing because there is an an accumulation of the impulse in the parabola (for instance, Ricker's impulse).
phi=pi/5;
b=4000;
if (phi>pi/4)|(phi<-pi/4)
warndlg('Invalid value');
else
a=tan(phi);
x=-4000:100:4000;
y=zeros(1,length(x));
z=a*x+b;
colormap(jet)
line1=plot(x,z,'y','LineWidth',3);xlim([-4000 4000]);ylim([0 7000]);
set(gca,'YDir','reverse');
xlabel('X,m');
shading interp
colormap(jet)
colorbar;
% zoom on
% %title({'Решение задачи сейсмического сноса' , 'для плоской наклонной границы методом огибающей'});
daspect([1 1 1])
zeta=z./cos(phi);
hold on
dz=z*tan(phi)+x;
line2=plot(dz,zeta,'r','LineWidth',3);
pause
for i=1:2:length(x)
xk=x(i)-4000:12.5:x(i)+4000;
d(i)=z(i)*tan(phi)+x(i);
hyp=sqrt((xk-x(i)).^2+z(i).^2);
plot(x(i),z(i),'.r','MarkerSize',25);
pause
plot(xk,hyp,'c');
end
end
clear all
close all

답변 (1개)

Image Analyst
Image Analyst 2020년 4월 5일
Not sure what you're asking. imagesc() applied to images, not plots. If you want to grab a snapshot of your axes with getframe() then you can call imshow() or imagesc() followed by rgb2gray() and colormap() if you want.
displayedImage = getframe(); % This is an RGB screenshot of the current axes.

카테고리

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

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by