How can I create a break in the y-axis (looking like a flash; example below)?
이전 댓글 표시
Hello community members,
I would be glad to get some help in order to create a break in the y-axis looking like the example below.
I've seen related posts concerning this topic, yet I've not been able to achieve the desired result myself.
All the best,
Max

댓글 수: 5
Hayden Garmon
2020년 9월 2일
Try checking here
https://blogs.mathworks.com/pick/2008/11/21/breaking-a-plot-to-improve-visualization/#3
Adam Danz
2020년 9월 2일
If your plots also do not contain any data below the break point, it might be easiest just to plot your, set the ylim so there's space at the bottom, and then change the y-tick-labels to represent the discontinuity. You can also add text at the break to indicate that there is a break.
J. Alex Lee
2020년 9월 3일
Even if you did have data below the breakpoint, you could "fake it" by shifting those data up, keeping track of the shift, and "fake" the yticklabel strings to account for the shifts.
Adam Danz
2020년 9월 3일
You may have to also vertically scale the data unless the tick intervals are the same below and above the break. If data are plotted below the break I would recommend using two axes that share a border. That way you don't have to deal with setting tick labels that don't match the actual ticks.
J. Alex Lee
2020년 9월 3일
ah yes, that makes more sense Adam! An alternative is to use yyaxis. Of course at this point we're deviating a bit from the original request, and our combined advice seems to be to just set the lower y axis limit to some value other than zero.
답변 (1개)
Bjorn Gustavsson
2020년 9월 3일
0 개 추천
There are several options on the File Exchange that claims to do exactly what you want. Have a look:
Tust a lazy man's advice: start every matlab-programming task/project with a File Exchange search!
HTH
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!