How to apply imagesc on the plot with two lines?

3 vues (au cours des 30 derniers jours)
Wasp Hamberg
Wasp Hamberg le 5 Avr 2020
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

Réponses (1)

Image Analyst
Image Analyst le 5 Avr 2020
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.

Catégories

En savoir plus sur Colormaps dans Help Center et File Exchange

Produits


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by