필터 지우기
필터 지우기

Eliminating an entire point on a plot both for data and on the axis

조회 수: 1 (최근 30일)
Krispy Scripts
Krispy Scripts 2017년 5월 5일
답변: dpb 2017년 5월 6일
I have a graph of power spectrum data. As is the case with notch filters, there is a dip at 60Hz for the filter. I am wondering if when I plot it, there is a way to completely excise out 60 on the X-axis so that both data and X-Axis omit 60?
  댓글 수: 2
dpb
dpb 2017년 5월 5일
What, specifically do you mean here by "omit"? Not show the data for some range about 60 Hz or to somehow truncate some range of the axis entirely? If the latter, what do you intend to do about joining the data regarding it's true position?
Krispy Scripts
Krispy Scripts 2017년 5월 5일
I want to make it obvious that the data is being omitted - so I was hoping to show a gap in the axis, as well as the data.
Does that make sense?

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

채택된 답변

dpb
dpb 2017년 5월 6일
Well, the most trivial would be
i60=60/df; % index of 60 hz in array
idel=delF/df; % the delta indices for the range
x(i60-idel:i60+del)=nan; % NaN data doesn't plot
plot(x,y) % plot the data
xt=get(gca,'xtick'); % retrieve tick values
i60t=find(xt==60); % assume is tick at 60
set(gca,'xtick',[xt(1:i60t-1) xt(i60t+1:end)])
The latter part on the axes above leaves a gap at that location.
comes from
axes
xlim([0 100])
xt=get(gca,'xtick');
ix=find(xt==60);
set(gca,'xtick',[xt(1:ix-1) xt(ix+1:end)])
You could always then draw a little cross line at the point to show break or somesuch else if need more emphasis yet.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2017년 5월 6일

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by