Remove dates from plot

조회 수: 10 (최근 30일)
davide pirino
davide pirino 2021년 9월 27일
댓글: Kevin Holly 2021년 9월 29일
I have to plot this time series
As you may notice there is a missing period immediately after 2012. I would like to remove this period. So I have done is this:
I have identified the ordinal number of the dates and I have removed both from x and y:
X(1553:1574) = [];
Y(1553:1574) = [];
But the result is the following
The time-series now looks as it is contant in the removed dates. Any suggestion on how to remove the period?

답변 (1개)

Kevin Holly
Kevin Holly 2021년 9월 27일
편집: Kevin Holly 2021년 9월 27일
An easy way to resolve this could be this:
plot(X(1:1552),Y(1:1552),'k')
hold on
plot(X(1575:end),Y(1575:end),'k')
Edit: I just realized I misunderstood what you wanted. You want to edit the x-axis scale? You can't just close the gap as your scale would be off. Did you want a break in scale?
If so, see:
  댓글 수: 2
davide pirino
davide pirino 2021년 9월 27일
I think you got what I want, because I do not want to break the x-axis, just remove from the graph the missing part. Unfortunately if I use your code nothing changes, still I have the missing part displayed in the graph.
Kevin Holly
Kevin Holly 2021년 9월 29일

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by