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

Try checking here
https://blogs.mathworks.com/pick/2008/11/21/breaking-a-plot-to-improve-visualization/#3
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.
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.
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.
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
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에 대해 자세히 알아보기

태그

질문:

2020년 9월 2일

댓글:

2020년 9월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by