comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: isodensity contours

Re: isodensity contours
type: item
description: Gray writes: > I have a scatterplot with a bunch of points on it. I'd like to plot > isodensity contours to include 99%, 90%, 75%, and 50% of my points. > How do I set up my data to give to cgContour? Thanks! The simple answer is, you set up your data the way you *always* set up your data! Don't you really want to know, how do I choose some percentage of my points? And, that question we can't answer, because you haven't indicated what the criteria are going to be. I guess you will have to decide. Randomly, distance from the centroid, based on height above surface, etc. Lot's of possibilities here. Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2011-02-23T18:39:28-00:00

Re: isodensity contours
type: item
description: On Feb 23, 1:24 pm, Gray <grayliketheco...@gmail.com> wrote: > Hi all, > > I have a scatterplot with a bunch of points on it. I'd like to plot > isodensity contours to include 99%, 90%, 75%, and 50% of my points. > How do I set up my data to give to cgContour? Thanks! > > --Gray If I understand this correctly, you have two arrays x and y of coordinates of N points. To contour them, you need first to create a density array from your dataset - basically you divide the xrange and yrange of your data in a number of bins and the density array will tell you how many points lie in each bin. Then you can use the normal contour procedures. So how you do partition the data into the density array? hist_2d will do that for you. Ciao, Paolo
creator: pgrigis
date: 2011-02-23T19:12:50-00:00

Re: isodensity contours
type: item
description: On Wednesday, February 23, 2011 1:24:30 PM UTC-5, Gray wrote: > Hi all, > > I have a scatterplot with a bunch of points on it. I'd like to plot > isodensity contours to include 99%, 90%, 75%, and 50% of my points. > How do I set up my data to give to cgContour? Thanks! > > --Gray You may find contourlevels in JBIU useful: http://web.astroconst.org/jbiu/jbiu-doc/misc/contourlevels.h tml -Jeremy.
creator: Jeremy Bailin
date: 2011-02-23T20:04:27-00:00

Re: isodensity contours
type: item
description: On Feb 23, 2:12 pm, Paolo <pgri...@gmail.com> wrote: > On Feb 23, 1:24 pm, Gray <grayliketheco...@gmail.com> wrote: > >> Hi all, > >> I have a scatterplot with a bunch of points on it. I'd like to plot >> isodensity contours to include 99%, 90%, 75%, and 50% of my points. >> How do I set up my data to give to cgContour? Thanks! > >> --Gray > > If I understand this correctly, you have two arrays > x and y of coordinates of N points. > > To contour them, you need first to create a > density array from your dataset - basically > you divide the xrange and yrange of your data > in a number of bins and the density array will > tell you how many points lie in each bin. > > Then you can use the normal contour procedures. > > So how you do partition the data into the density > array? hist_2d will do that for you. > > Ciao, > Paolo I thought I posted this already... if it shows up twice, I'm sorry. Upon further reflection, I think that "isodensity contours" are not exactly what I want, though I may need to use them anyway (as described by Paolo) if I can't figure out a way to do EXACTLY what I want. Here's some more detail on my issue. I have a plot for which the x- axis is stellar magnitude in one image, and the y-axis is stellar magnitude in a different image. I have two populations of stars (pop A and pop B). Pop A is pretty clustered, but the cluster is sort of smeared out so I can't use a simple centroid. I'd like to see where the pop B stars lay on the plot in relation to the pop A stars by plotting contours showing what percentage of pop A stars are within them (99%,90%,75%,50%). Is this doable without getting really complicated, or should I use the isodensity contours instead? An example image is at http://tinypic.com/r/2mepz4/7 The black points are pop A and the colored symbols are pop B. Thanks for your help! --Gray
creator: Gray
date: 2011-02-23T20:06:58-00:00

Re: isodensity contours
type: item
description: On Feb 23, 3:06 pm, Gray <grayliketheco...@gmail.com> wrote: > On Feb 23, 2:12 pm, Paolo <pgri...@gmail.com> wrote: > > > > > > > > > >> On Feb 23, 1:24 pm, Gray <grayliketheco...@gmail.com> wrote: > >>> Hi all, > >>> I have a scatterplot with a bunch of points on it. I'd like to plot >>> isodensity contours to include 99%, 90%, 75%, and 50% of my points. >>> How do I set up my data to give to cgContour? Thanks! > >>> --Gray > >> If I understand this correctly, you have two arrays >> x and y of coordinates of N points. > >> To contour them, you need first to create a >> density array from your dataset - basically >> you divide the xrange and yrange of your data >> in a number of bins and the density array will >> tell you how many points lie in each bin. > >> Then you can use the normal contour procedures. > >> So how you do partition the data into the density >> array? hist_2d will do that for you. > >> Ciao, >> Paolo > > I thought I posted this already... if it shows up twice, I'm sorry. > > Upon further reflection, I think that "isodensity contours" are not > exactly what I want, though I may need to use them anyway (as > described by Paolo) if I can't figure out a way to do EXACTLY what I > want. > > Here's some more detail on my issue. I have a plot for which the x- > axis is stellar magnitude in one image, and the y-axis is stellar > magnitude in a different image. I have two populations of stars (pop > A and pop B). Pop A is pretty clustered, but the cluster is sort of > smeared out so I can't use a simple centroid. I'd like to see where > the pop B stars lay on the plot in relation to the pop A stars by > plotting contours showing what percentage of pop A stars are within > them (99%,90%,75%,50%). Is this doable without getting really > complicated, or should I use the isodensity contours instead? > > An example image is athttp://tinypic.com/r/2mepz4/7 > The black points are pop A and the colored symbols are pop B. > > Thanks for your help! > > --Gray I woul…
creator: pgrigis
date: 2011-02-23T20:24:10-00:00

Re: isodensity contours
type: item
description: On Feb 23, 3:04 pm, Jeremy Bailin <astroco...@gmail.com> wrote: > On Wednesday, February 23, 2011 1:24:30 PM UTC-5, Gray wrote: >> Hi all, > >> I have a scatterplot with a bunch of points on it. I'd like to plot >> isodensity contours to include 99%, 90%, 75%, and 50% of my points. >> How do I set up my data to give to cgContour? Thanks! > >> --Gray > > You may find contourlevels in JBIU useful: > > http://web.astroconst.org/jbiu/jbiu-doc/misc/contourlevels.h tml > > -Jeremy. Oh, perfect! Thank you!
creator: Gray
date: 2011-02-23T21:25:38-00:00

Re: isodensity contours
type: item
description: On Feb 23, 3:24 pm, Paolo <pgri...@gmail.com> wrote: > On Feb 23, 3:06 pm, Gray <grayliketheco...@gmail.com> wrote: > > > > > > > > > >> On Feb 23, 2:12 pm, Paolo <pgri...@gmail.com> wrote: > >>> On Feb 23, 1:24 pm, Gray <grayliketheco...@gmail.com> wrote: > >>>> Hi all, > >>>> I have a scatterplot with a bunch of points on it. I'd like to plot >>>> isodensity contours to include 99%, 90%, 75%, and 50% of my points. >>>> How do I set up my data to give to cgContour? Thanks! > >>>> --Gray > >>> If I understand this correctly, you have two arrays >>> x and y of coordinates of N points. > >>> To contour them, you need first to create a >>> density array from your dataset - basically >>> you divide the xrange and yrange of your data >>> in a number of bins and the density array will >>> tell you how many points lie in each bin. > >>> Then you can use the normal contour procedures. > >>> So how you do partition the data into the density >>> array? hist_2d will do that for you. > >>> Ciao, >>> Paolo > >> I thought I posted this already... if it shows up twice, I'm sorry. > >> Upon further reflection, I think that "isodensity contours" are not >> exactly what I want, though I may need to use them anyway (as >> described by Paolo) if I can't figure out a way to do EXACTLY what I >> want. > >> Here's some more detail on my issue. I have a plot for which the x- >> axis is stellar magnitude in one image, and the y-axis is stellar >> magnitude in a different image. I have two populations of stars (pop >> A and pop B). Pop A is pretty clustered, but the cluster is sort of >> smeared out so I can't use a simple centroid. I'd like to see where >> the pop B stars lay on the plot in relation to the pop A stars by >> plotting contours showing what percentage of pop A stars are within >> them (99%,90%,75%,50%). Is this doable without getting really >> complicated, or should I use the isodensity contours instead? > >> An example image is athttp://tinypic.com/r/2mepz4/7 >> The black poi…
creator: Gray
date: 2011-02-24T00:34:54-00:00

Re: isodensity contours
type: item
description: On Feb 23, 1:39 pm, David Fanning <n...@idlcoyote.com> wrote: > Gray writes: >> I have a scatterplot with a bunch of points on it. I'd like to plot >> isodensity contours to include 99%, 90%, 75%, and 50% of my points. >> How do I set up my data to give to cgContour? Thanks! > > The simple answer is, you set up your data the way > you *always* set up your data! > > Don't you really want to know, how do I choose > some percentage of my points? And, that question > we can't answer, because you haven't indicated > what the criteria are going to be. I guess > you will have to decide. Randomly, distance > from the centroid, based on height above surface, > etc. Lot's of possibilities here. > > Cheers, > > David > > -- > David Fanning, Ph.D. > Fanning Software Consulting, Inc. > Coyote's Guide to IDL Programming:http://www.idlcoyote.com/ > Sepore ma de ni thui. ("Perhaps thou speakest truth.") David - When I actually try to plot the contour, it doesn't work. My x and y inputs to cgContour are xb and yb: IDL> print, minmax(xb), minmax(yb) 5.92672 20.6767 -9.38564 7.11436 Why does the contour plot out in space? http://tinypic.com/r/2viio7l/7
creator: Gray
date: 2011-02-24T01:30:41-00:00

Re: isodensity contours
type: item
description: Gray writes: > When I actually try to plot the contour, it doesn't work. My x and y > inputs to cgContour are xb and yb: > IDL> print, minmax(xb), minmax(yb) > 5.92672 20.6767 > -9.38564 7.11436 > > Why does the contour plot out in space? http://tinypic.com/r/2viio7l/7 Are you setting the OVERPLOT keyword, so that it plots onto the axes that are already established? Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2011-02-24T01:43:49-00:00

Re: isodensity contours
type: item
description: On Feb 23, 8:43 pm, David Fanning <n...@idlcoyote.com> wrote: > Gray writes: >> When I actually try to plot the contour, it doesn't work. My x and y >> inputs to cgContour are xb and yb: >> IDL> print, minmax(xb), minmax(yb) >> 5.92672 20.6767 >> -9.38564 7.11436 > >> Why does the contour plot out in space? http://tinypic.com/r/2viio7l/7 > > Are you setting the OVERPLOT keyword, so that it > plots onto the axes that are already established? > > Cheers, > > David > > -- > David Fanning, Ph.D. > Fanning Software Consulting, Inc. > Coyote's Guide to IDL Programming:http://www.idlcoyote.com/ > Sepore ma de ni thui. ("Perhaps thou speakest truth.") Yes. Here's my cgContour call: cgcontour, contour_in, xb, yb, /overplot, levels=lev, label=0
creator: Gray
date: 2011-02-24T01:48:44-00:00

Re: isodensity contours
type: item
description: Gray writes: > Yes. Here's my cgContour call: > cgcontour, contour_in, xb, yb, /overplot, levels=lev, label=0 Well, I don't know. Maybe it's doing the right thing. :-) What does the contour plot look like by itself? Do you get the same thing when you use the Contour command? I'm off to play tennis tonight, but if you want to send me a save file with the data, maybe I can look at it later. Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2011-02-24T02:02:49-00:00

Re: isodensity contours
type: item
description: On Feb 23, 7:34 pm, Gray <grayliketheco...@gmail.com> wrote: > On Feb 23, 3:24 pm, Paolo <pgri...@gmail.com> wrote: > > > > > > > > > >> On Feb 23, 3:06 pm, Gray <grayliketheco...@gmail.com> wrote: > >>> On Feb 23, 2:12 pm, Paolo <pgri...@gmail.com> wrote: > >>>> On Feb 23, 1:24 pm, Gray <grayliketheco...@gmail.com> wrote: > >>>> > Hi all, > >>>> > I have a scatterplot with a bunch of points on it. I'd like to plot >>>> > isodensity contours to include 99%, 90%, 75%, and 50% of my points. >>>> > How do I set up my data to give to cgContour? Thanks! > >>>> > --Gray > >>>> If I understand this correctly, you have two arrays >>>> x and y of coordinates of N points. > >>>> To contour them, you need first to create a >>>> density array from your dataset - basically >>>> you divide the xrange and yrange of your data >>>> in a number of bins and the density array will >>>> tell you how many points lie in each bin. > >>>> Then you can use the normal contour procedures. > >>>> So how you do partition the data into the density >>>> array? hist_2d will do that for you. > >>>> Ciao, >>>> Paolo > >>> I thought I posted this already... if it shows up twice, I'm sorry. > >>> Upon further reflection, I think that "isodensity contours" are not >>> exactly what I want, though I may need to use them anyway (as >>> described by Paolo) if I can't figure out a way to do EXACTLY what I >>> want. > >>> Here's some more detail on my issue. I have a plot for which the x- >>> axis is stellar magnitude in one image, and the y-axis is stellar >>> magnitude in a different image. I have two populations of stars (pop >>> A and pop B). Pop A is pretty clustered, but the cluster is sort of >>> smeared out so I can't use a simple centroid. I'd like to see where >>> the pop B stars lay on the plot in relation to the pop A stars by >>> plotting contours showing what percentage of pop A stars are within >>> them (99%,90%,75%,50%). Is this doable without getting really >>> complicated, or should I use th…
creator: pgrigis
date: 2011-02-24T16:28:29-00:00