Code covered by the BSD License  

Highlights from
marginhist.m

4.83333

4.8 | 6 ratings Rate this file 15 Downloads (last 30 days) File Size: 1.69 KB File ID: #4359
image thumbnail

marginhist.m

by Peter Perkins

 

12 Jan 2004 (Updated 30 Nov 2009)

2D scatterplot w/marginal histograms.

| Watch this File

File Information
Description

This function creates a 2D scatterplot from two data vectors, and puts a univariate histogram for each vector at the horizontal and vertical axes of the plot.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
2d, axes, histogram, plot, plotting, scatterplot, specialized, vector
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
14 Jun 2011 Allen

Would be great to have a switch to turn on or off either axis (for instance time-series data). Also would be wonderful to have hlines or vlines for std's whenever desired. (or a colored transparent rectangle showing 1 std)

Also would be wonderful to allow for multiple data sets. :) [I'm sure I can come up with more for you to code as well... great submission!]

27 Mar 2011 J G

is there any way to use this function in a subplot? Thanks!

06 Oct 2010 Scott McKinney

This function is quite good. However, for aesthetics, it would be nice to have that supporting line on the x-axis histogram as well as on the y-axis histogram.

This can be achieved by replacing
subplot(2,2,4); bar(cx,-nx,1); h2 = gca; axis([xlim -max(nx)*1.01 0]); axis('off');

with

subplot(2,2,4); bar(cx,-nx,1); line(xlims,[0 0],'Color','k'); h2 = gca; axis([xlim -max(nx)*1.01 0.01]); axis('off');

10 Jan 2010 Mohammed

perfectt !!

20 Nov 2008 Maximilien Chaumon

Perfect, should be included in future matlab versions.

12 Jan 2007 Ken Mackay

just what I need

Updates
25 Jun 2009

change name, standardize header info, add copyright

30 Nov 2009

Rename to marginhist.m.

Contact us