Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!3g2000yqk.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Please Help, How to calculate the area percentage of each color 
	in a contour map?
Date: Thu, 11 Jun 2009 01:35:44 -0700 (PDT)
Organization: http://groups.google.com
Lines: 36
Message-ID: <97e3fbc1-db73-4c25-b961-c8771cef00fe@3g2000yqk.googlegroups.com>
References: <h0oll9$r0s$1@fred.mathworks.com> <c1d7887a-da8f-4521-baa5-9d764061ac5e@o36g2000vbi.googlegroups.com>
NNTP-Posting-Host: 77.16.119.96
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1244709344 30787 127.0.0.1 (11 Jun 2009 08:35:44 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 11 Jun 2009 08:35:44 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 3g2000yqk.googlegroups.com; posting-host=77.16.119.96; 
	posting-account=VAp5gAkAAAAmkCze5hvZtMeedpZWNthI
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET 
	CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:546455


On 10 Jun, 22:35, ImageAnalyst <imageanal...@mailinator.com> wrote:
> On Jun 10, 12:06 pm, "Hooman " <hoom...@rci.rutgers.edu> wrote:
>
> > Hello all,
> > have a rectangular m by n matrix of points and based on a simple function I want to make a contour map with it. but additional to that I also want to know what is the percentage of area of each color in my contour map, (assume I have only four colors).
>
> > can anyone help me with this?
>
> ---------------------------------------------------------------------------­-------------------------
> You can take the histogram of your array to get the area fractions
> between certain numerical levels.  

Yes, but that does not solve the problem. Consider this:

d = zeros(5);
d(3,3) = 1;

Now we have 25 data points of which 24 points (96%) contain
the value 0 and one point (4%) contains the value 1. These
are the numbers the historgram method will find.

However, when one plots the contour map,

contourf(d)

one sees that there are non-zero contributions from a number
of value intervals that the histogram just misses.

So the OP needs to sort out whether he wants info on the
data or on the figure.

Rune