Clear Filters
Clear Filters

How do I specify a specific color for a specific value for velocity in seismic velocity modelling?

1 view (last 30 days)
x=[-500 500 500 -500 -500];
y=[0 0 -20 -20 0];
fill(x,y,[0.3010 0.7450 0.9330]);
hold on;
y1=[-20 -20 -30 -30 -20];
fill(x,y1,[0.7010 0.7450 0.9330]);
y2=[-30 -30 -50 -50 -30];
fill(x,y2,[0.2010 0.7450 0.130]);
xlabel('Offset');
ylabel('Depth');
title('Velocity Model');
set(gca,'ydir','reverse');set(gca,'xaxislocation','top');
hold off
I have used this code and want to assign the valus of velocity 550 750 1000 for the rectangles respective and add a colorbar with the value of velocity

Accepted Answer

Scott MacKenzie
Scott MacKenzie on 30 Jun 2021
I think this is more or less what you are after. The code includes an example of adding text and a rectangle. You can customize these as per your data and needs.
y = 180:10:340;
c = repmat(y',1,6);
p = pcolor(flip(c));
p.FaceColor = 'interp';
p.LineStyle = 'none';
colormap jet;
cb = colorbar;
cb.Label.String = 'S Velocity (m/s)';
ax = gca;
ax.YDir = 'reverse';
ax.XTickLabel = num2cell(10:10:60);
ax.YTickLabel = num2cell(1:8);
ax.XLabel.String = 'X (m)';
ax.YLabel.String = 'Z (m)';
% examples of adding text and rectangle
text(3.6, 8, 'Example text', 'horizontalalignment', 'center', 'fontsize', 18);
rectangle('position', [2 9 3 2]);

More Answers (0)

Community Treasure Hunt

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

Start Hunting!