Code covered by the BSD License  

Highlights from
Function to make a 2D histogram

5.0

5.0 | 1 rating Rate this file 20 Downloads (last 30 days) File Size: 1.41 KB File ID: #29709
image thumbnail

Function to make a 2D histogram

by Sisi Ma

 

14 Dec 2010

Make 2D histogram on pairs of (x,y) data

| Watch this File

File Information
Description

%A Simple function that makes a 2D histgram

% Input: data: two cols, x value; y value
% xrange: range and bins for x value (edges)
% yrange: range and bins for y value (edges)
%Output: Count of a specifice (x,y) bin combination;
% Suggested visualizing tool: I like to use imagesc; bar3 will work fine
% too; have to change axis label though

Example:
data(:,1)=randn(100000,1);
data(:,2)=randn(100000,1);
count=hist2d(data,-1:0.1:1,-1:0.1:1);
imagesc(count);

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
16 Dec 2010 Gary

Doug Hull posted a video showing how to do this without for loops: http://blogs.mathworks.com/videos/2010/01/22/advanced-making-a-2d-or-3d-histogram-to-visualize-data-density/

17 Jan 2012 Pablo  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
histogram Sisi Ma 14 Dec 2010 15:40:25
2 dimension visualization Sisi Ma 14 Dec 2010 15:40:25
data exploration Sisi Ma 14 Dec 2010 15:40:25

Contact us at files@mathworks.com