View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.5 | 7 ratings Rate this file 28 Downloads (last 30 days) File Size: 1.64 KB File ID: #3683 Version: 1.0
image thumbnail




03 Jul 2003 (Updated )

Inserts < // > into a 'broken' or discontinuous x-axis.

| Watch this File

File Information

h=BreakXAxis(x,y,start,stop,width) plots (x,y) and breaks the plot's x-axis between <start> and <stop>, by inserting a broken-axis symbol < // > into a space <width> wide. This type of plot is often used in scientific papers, when the data between <start> and <stop> isn't interesting. The code can be easily modified (swap y for x) to break the y-axis.


Break Axis inspired this file.

This file inspired Break X Axis.

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (10)
19 Sep 2016 chengshou lai

17 Jun 2016 Konrad Tarka


i have trouble getting this function work properly.

I have a two 3631x1 double matrices (x1 and y1) that I want to plot with a break in the X-axis.

Whe I try to use this function by:

BreakXAxis(x1,y2,1750, 2500,1);

Matlab complains that there is not the correct amount of arguments. From what I can see there should be 5.

Could anyone get me on track, as this seems to be a great function.



Comment only
23 Jul 2014 Pascale Lelong

Great program. Does exactly what I needed!

17 Aug 2011 Aurélien BERTIN

I don't understand how you can do the same on y-axis. Can you explain? What do I have to change in code? Thanks

Comment only
23 Apr 2011 Richard Rieber

Richard Rieber (view profile)

Great function. I was trying to do this for a bar chart, so it doesn't apply. Seems like it would be simple to adapt. However, I did notice that the function uses max(ytick) to calculate where to put the '//' on the upper x-axis. This may not work in cases where the maximum ytick is not on the upper y-axis. Perhaps use:

> v = axis;
> t2 = text(start+width/2,v(4),'//','fontsize',15);

10 Jun 2010 Ashok Reddy

Nice work. Any later version of Matlab has such a functionality built-in?

09 Feb 2010 alex marin

Nice, but the break mark on the x axis does not have a "professional" look as in e/g/ origin.

Comment only
30 Jun 2009 Joseph

Joseph (view profile)

30 Jun 2009 Joseph

Joseph (view profile)

Wow! Great work.

i) it is usually desirable to have width as small as feasible

ii)it's really easy to add your own style text parameter to the function so that you can do more than the default blue dot.

REALLY GREAT !!! A manager at our company really loved it -- need I say more!

17 Jun 2009 Ale Guillén-Mandujano

Contact us