Code covered by the BSD License  

Highlights from
rug plots

4.0

4.0 | 1 rating Rate this file 9 Downloads (last 30 days) File Size: 2.61 KB File ID: #27582
image thumbnail

rug plots

by Rob Campbell

 

11 May 2010 (Updated 18 Jun 2010)

Creates a so-called "rug" plot similar to those produced by the free stats package, R.

| Watch this File

File Information
Description

A rug plot is a compact way of illustrating the marginal distributions of a variable along x and y. Positions of the data points along x and y are denoted by tick marks, reminiscent of the tassels on a rug.

Known Issues:
Rug marks are overlaid onto the same axis as the original data. Changing the axis dimensions after calling rug will therefore cause the tick marks to become disassociated from the axes.
 
I haven't tested this function extensively so let me know if you find any problems.

Acknowledgements

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

MATLAB release MATLAB 7.10 (2010a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
02 May 2012 Carl Witthoft

Nice -- did what I expected for a few quick tests.
Feature request: allow addition of 'jitter' to data so that repeated values are drawn with slight offsets so as to provide better qualitative view of the density. (I believe the R function has this option).

Please login to add a comment or rating.
Updates
12 May 2010

Allow tick mark length to be defined at the command line.

13 May 2010

Tidy and correct comments. Check that tickScaleFactor is between 0 and 1.

18 Jun 2010

minor updates to summary

Tag Activity for this File
Tag Applied By Date/Time
rug Rob Campbell 12 May 2010 09:58:26
plot Rob Campbell 12 May 2010 09:58:26
distribution Rob Campbell 12 May 2010 09:58:26
histogram Rob Campbell 12 May 2010 09:58:26
scatter plot Rob Campbell 18 Jun 2010 12:11:45

Contact us at files@mathworks.com