Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15593 > unrolled thread

finding area in ListContourPlot

Started bySam McDermott <samwell187@gmail.com>
First post2011-02-02 11:07 +0000
Last post2011-02-04 06:44 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  finding area in ListContourPlot Sam McDermott <samwell187@gmail.com> - 2011-02-02 11:07 +0000
    Re: finding area in ListContourPlot "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> - 2011-02-03 10:39 +0000
      Re: finding area in ListContourPlot Sam McDermott <samwell187@gmail.com> - 2011-02-04 06:44 +0000

#15593 — finding area in ListContourPlot

FromSam McDermott <samwell187@gmail.com>
Date2011-02-02 11:07 +0000
Subjectfinding area in ListContourPlot
Message-ID<iibdtk$nod$1@smc.vnet.net>
Hi-

I'm new to the site, and I've searched around a bit for the solution to this problem, but the answer doesn't seem too tractable. The nearest I've gotten was here: https://groups.google.com/forum/?fromgroups#!searchin/comp.soft-sys.math.mathematica/finding$20area$20of$20a$20contour$20region/comp.soft-sys.math.mathematica/Hs6KIWL3fvE/DnZQm6joE0gJ

I would like to find the area bounded by the 95% confidence level of an object like <plotname>=ListContourPlot[<listname>,Contours->chimin+9.2]. In the first place, I'm having trouble getting a list of the points that bound the contour region. I can use FullForm[<plotname>], followed by hunting through the (huge) FullForm output to do this, but I'd like to automate the process since I'll have to do this operation for dozens of contour plots.

Any help finding the area of region bounded in ListContourPlot or at least getting a list of points that define the region would be most appreciated.

Thanks very much,
Sam

[toc] | [next] | [standalone]


#15746

From"Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com>
Date2011-02-03 10:39 +0000
Message-ID<iie0lj$c3t$1@smc.vnet.net>
In reply to#15593
Hi Sam,

I'm not sure how you would define a 95% confidence interval in a
ListContourPlot, but assuming it is a given contour level value in
your contour plot here's an example of how you could do this.

I put it in separate steps for clarity, but you could do it in one
line. Please note that if you specify a certain contour level for
drawing you need curly brackets around it. So the syntax differs from
your skeleton example.

(*example data*)
ed = Flatten[
   Table[{x, y, Exp[-x^2 - 2 y^2]}, {x, -1, 1, .1}, {y, -1, 1, .1}],
   1];

(*plot*)
pl = ListContourPlot[ed, Contours -> {0.5}, ContourShading -> False] //
Normal;
(*Normal converts GraphicsComplex constructions to more useful
primitives with plain coordinates*)

(*finding point set*)
Cases[pl, Line[a___] -> a, Infinity]

Note that depending on your data set there may be more contour lines
and they need not be closed.

Now that you have the coordinates you can use the method described in
the link you specified to calculate the area.

Hope this helps.

Cheers -- Sjoerd


On Feb 2, 12:07 pm, Sam McDermott <samwell...@gmail.com> wrote:
> Hi-
>
> I'm new to the site, and I've searched around a bit for the solution to t=
his problem, but the answer doesn't seem too tractable. The nearest I've go=
tten was here:https://groups.google.com/forum/?fromgroups#!searchin/comp.so=
ft-sys.m...
>
> I would like to find the area bounded by the 95% confidence level of an o=
bject like <plotname>=ListContourPlot[<listname>,Contours->chimin+9.2]. I=
n the first place, I'm having trouble getting a list of the points that bou=
nd the contour region. I can use FullForm[<plotname>], followed by hunting =
through the (huge) FullForm output to do this, but I'd like to automate the=
 process since I'll have to do this operation for dozens of contour plots.
>
> Any help finding the area of region bounded in ListContourPlot or at leas=
t getting a list of points that define the region would be most appreciated=
.
>
> Thanks very much,
> Sam

[toc] | [prev] | [next] | [standalone]


#15993

FromSam McDermott <samwell187@gmail.com>
Date2011-02-04 06:44 +0000
Message-ID<iig78n$rm3$1@smc.vnet.net>
In reply to#15746
Thanks so much for the help! This seems to extract everything in the
correct way.

All the best,
Sam

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web