Code covered by the BSD License  

Highlights from
BreakXAxis

4.25

4.2 | 5 ratings Rate this file 54 Downloads (last 30 days) File Size: 1.64 KB File ID: #3683
image thumbnail

BreakXAxis

by Julie Haas

 

03 Jul 2003 (Updated 08 Jul 2003)

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

| Watch this File

File Information
Description

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.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
BreakAxis

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
17 Jun 2009 Ale Guillén-Mandujano  
30 Jun 2009 Joseph

Wow! Great work.

NOTE TO USERS:
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!

30 Jun 2009 Joseph  
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.

10 Jun 2010 Ashok Reddy

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

23 Apr 2011 Richard Rieber

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);

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

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
specialized Julie Haas 22 Oct 2008 07:04:19
plotting Julie Haas 22 Oct 2008 07:04:19
break axis Julie Haas 22 Oct 2008 07:04:19
broken Julie Haas 22 Oct 2008 07:04:19
discontinuous Julie Haas 22 Oct 2008 07:04:19
xaxis Julie Haas 22 Oct 2008 07:04:19
graphics Julie Haas 22 Oct 2008 07:04:19
specialized plot Julie Haas 22 Oct 2008 07:04:19
break axis Ameur 12 Feb 2010 09:56:37
broken Andrew Stewart 29 Sep 2010 04:55:37
break axis J 02 Apr 2011 11:51:22
break axis Jared 17 Aug 2011 11:58:39
break axis Jaroslav 19 Oct 2011 09:15:58
break axis Giovanni Isella 28 Mar 2012 07:17:07
break axis Amine 15 Apr 2012 13:31:14

Contact us at files@mathworks.com