Break in the axis

조회 수: 653 (최근 30일)
Niles Martinsen
Niles Martinsen 2012년 7월 2일
답변: yanan LIU 2020년 2월 29일
Hi
I have a plot of data points (x, y). The issue is that one of the first data points has a very large amplitude, whereas the rest of the data points have very small magnitudes. So what I thought that I wanted to do is to make a "cut" in the y-axis, such that it goes from 0..1 and then skips to 100..105. Perhaps with a mark such as this "----//----" in between.
Is that possible in MatLAB?
Best, Niles.

채택된 답변

Thomas
Thomas 2012년 7월 2일
편집: Thomas 2012년 7월 2일
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2012년 7월 2일
Nice find!

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

추가 답변 (3개)

yanan LIU
yanan LIU 2020년 2월 29일
There is no direct function as I know.
But you can try to plot the double line on your figure.
for example,
x=1:10;
y=sin(x);
plot(x,y,'k*-','LineWidth',1.5,'MarkerSize',8);
axes('Position',[.1 .78 .05 .05]);
px=[1 5];
py1=[1 2];
height=1;
py2=py1+height;
plot(px,py1,'k','LineWidth',2);hold all;
plot(px,py2,'k','LineWidth',2);hold all;
fill([px flip(px)],[py1 flip(py2)],'w','EdgeColor','none');
box off;
axis off;
Then you can get the follow figure.

Peter
Peter 2013년 8월 1일

Philippe Lebel
Philippe Lebel 2018년 8월 22일
https://www.mathworks.com/matlabcentral/fileexchange/3683-breakxaxis
It does EXACTLY what you want to do.
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 8월 22일
That's what Thomas suggested 6 years ago.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by