I need to plot a line over my imagesc

조회 수: 12 (최근 30일)
raj
raj 2012년 1월 19일
I have checked matlabcentral but not found the write one i need to plot a line which starts from a point on the y-axis to the corner of the image that is to the end of x-axis
  댓글 수: 1
raj
raj 2012년 1월 19일
I have a spectrogram of a chirp signal i need to plot a line over
the chirp signal hope it makes things clear

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2012년 1월 19일
xoff = 7.38; %for example. Start drawing from (xoff,0)
ymax = get(gca, 'YLim');
hold on
plot([xoff xoff], [0 ymax], 'r:'); %change r: as needed
Note: This will draw a line according to the current top of the x axis. The details of this method will have difficulty if you pan or zoom.
I was unsure about where you wanted the line to go. If you want it to go along the y-axis to the end of the x-axis, then
xoff = 7.38; %for example. Start drawing from (xoff,0)
xmax = get(gca, 'XLim');
hold on
plot([xoff xmax], [0 0], 'r:'); %change r: as needed

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by