How to make a break on the x axis?

조회 수: 23 (최근 30일)
hello
hello 2017년 8월 24일
댓글: Lea 2024년 5월 4일
Suppose I have a plot and I want to start at 0 on the x axis(every 10 units) but I also want a break so that after zero my next point is 100 instead of 20. My numbers on x axis should look like 0, break, 100,110,120 etc. I know there is also some symbol to represent the break on the axis.
  댓글 수: 2
Brando Miranda
Brando Miranda 2018년 7월 11일
did u find what u were looking for?
Lea
Lea 2024년 5월 4일

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

답변 (3개)

KL
KL 2017년 8월 24일
plot(rand(150,1))
xticks([0 100 120 150])
  댓글 수: 4
hello
hello 2017년 8월 24일
Actually I am trying to break the xaxis on the histogram.
KL
KL 2017년 8월 24일
It would be efficient if you could explain your question clearly instead of your short responses. Also it's easier to help if you provide us some sample data and code that you're working with. Have you checked out the link Jan gave on his answer?

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


Jan
Jan 2017년 8월 24일
Take a look into the file exchange:
Even a search in the internet for "Matlab axis break" will be useful. I like the power of this forum, but asking an internet search engine is usually much faster than waiting for a person to post a solution.
  댓글 수: 1
Maulik Shah
Maulik Shah 2018년 5월 11일
Hi Jan, Is there any way to break x-axis in loglog plot? Thanks,

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


Serge Mooyman
Serge Mooyman 2018년 8월 14일
편집: Serge Mooyman 2018년 8월 14일
Hey, well, okay, I got the function breakxaxis running, and have a beautiful break just where I want, but.... I need several in the same graph. I tried "hold on" and then a new command, in this case:
i = breakxaxis([100 120]);
However, this gives an error:
Error using breakxaxis (line 75) splitXLim must be in the range given by get(AX,'XLim')
Bottom line: does anyone know a way to include more than one braek in your X axis?
I would love to know
Serge
  댓글 수: 2
Ehsan Amin
Ehsan Amin 2020년 4월 20일
Hi there, I used subplot and repositioned them to have desired figure. You can invisible ticks to have axis line in break region. by this way you can have several breaks in both x and y axis.
franco otaola
franco otaola 2020년 7월 23일
hello ehsan,
would it be possible to show the script how you have done it?
best regards

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by