Edit/deleted the question

조회 수: 1 (최근 30일)
--
-- 2017년 11월 30일
답변: Image Analyst 2023년 6월 15일
Edit
  댓글 수: 1
Stephen23
Stephen23 2023년 6월 15일
Original question by Nadiya Khosravi retrieved from Google Cache:
How to make a break on x axis and have two sets of values?
hi i have to plot a graph where im given the daily temperature for five lakes for a year (366 days). we are asked to make a graph for winter days only (days 1 to 79 and days 355 to 366) with all 5 lakes on one graph. i know that if i want to make a graph for the whole year with all the lakes on one graph i have to do:
x=[1:366];
y=[1:366];
y1= lakeerie
y2= lakehuron
y3= lakemichigan
y4= lakeontario
y5= lakesuperior
plot(x,y1,x,y2,x,y3,x,y4,x,y5)
ylim([0 25])
where x represents the days and y represents the temperature in degree Celsius
but how do i only show the values for days 1 to 79 and days 355 to 366?

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

답변 (2개)

Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2017년 11월 30일
indx1 = 1:79;
indx2 = 355:366;
figure; hold on;
plot(x(indx1),y1(indx1),...);
plot(x(indx2),y1(indx2),...);

Image Analyst
Image Analyst 2023년 6월 15일
There are plenty of submissions in the File Exchange for plots with broken axes (skips or gaps in the axis):

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by