[SciPy-user] Getting coordinates of a level (contour) curve

Stéfan van der Walt stefan@sun.ac...
Tue Aug 12 00:54:35 CDT 2008


2008/8/11 Bing <bing.jian@gmail.com>:
>> I have a fixed bivariate gaussian density function, and I want to
>> compute the coordinates (x(l), y(l)) of a given level curve, where l
>> is the parameter of the curve. I can easily plot the level x curve
>> with matplotlib, using function 'contour', but I have no idea about
>> how to get its coordinates (something like an (N,2) array specifying
>> the  coordinates of N points along the curve). With fsolve I can find
>> one of such points, but its is not enough :)
>
> For bivariate normal distributions, these equal-density contours
> are ellipses which you can write down the parametric form
> of (x,y) from the mean and covariance matrix of your bivariate normal
> distribution.

For those who are interested in plotting these:

http://mentat.za.net/refer/gaussian_intersection.png

(See also attached code)

Stéfan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gaussian_intersection.py
Type: application/octet-stream
Size: 3814 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20080812/745e2a4a/attachment-0001.obj 


More information about the SciPy-user mailing list