how to find the length between two ticks ?

3 次查看(过去 30 天)
Hello Everybody
I need your help.
I am trying to plot a scale on my graph,I did it with the help of my last question
now to plot the value on my horizontal line on the sclae(left top , ? cm/s) I need to have the length between each plot(interval). how many mm or cm is between data on point 0km and point 5km(interval between ticks).I don't know how to find this length!
Then I probably need to find the max of each data and divide it to this lenght. I suppose this will give me the answer for ?m/s
Thank you

回答(2 个)

KSSV
KSSV 2019-1-23
Read about imdistline. With this you can get the distance interactivley....If you want by code..you need to pick the points and use distance formula.
  4 个评论
Samaneh Arzpeima
Samaneh Arzpeima 2019-1-23
"getpts" also is an "image processing toolbox " option.
KSSV
KSSV 2019-1-23
huumh...then ginput ..what daata you have in hand by the way?

请先登录,再进行评论。


Samaneh Arzpeima
Samaneh Arzpeima 2019-1-23
编辑:Samaneh Arzpeima 2019-1-23
this is a 2d figure but it actually has 3 parametrs. I am trying to plot time history of velocity on specific point of space. 
t=time(:,1); %10000*1
y=alongstrike(1,:); %1*41 (-100:5:100)
hold all
figure()
for i=1:41
plot((sliprate(:,i).*20+alongstrike(1,i)),time(:,i)) %sliprate is 10000*41
end
ylim([0 100])
set(gca,'Xdir','reverse')
xlabel('Strike direction (km)','FontSize',12)
ylabel('Time (s)','FontSize',12)
hold on
plot([80; 85], [110; 110], '-k', [80; 80], [110; 120], '-k', 'LineWidth', 2)
hold off
axis([[-110 110] 0 120])
text(82,115, '10 s', 'HorizontalAlignment','right')
text(88,107, '? cm/s', 'HorizontalAlignment','center')
set(gca, 'YTick', [0:20:100])
hold on
plot([60; 80], [10; 15], '-k', [60; 80], [10; 25], '-k','LineWidth', 2)
hold off
text(85,28, '2 km/s', 'HorizontalAlignment','center')
text(85,18, '4 km/s', 'HorizontalAlignment','center')
now need to plot the scale on figure.

类别

Help CenterFile Exchange 中查找有关 Grid Lines, Tick Values, and Labels 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by