comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Fill intersection of two contours
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Fill intersection of two contours [message #55446] Thu, 23 August 2007 02:23
burkina is currently offline  burkina
Messages: 32
Registered: February 2005
Member
On Aug 22, 5:22 pm, Brian Larsen <balar...@gmail.com> wrote:
> While I am sure there is a much more elegant solution this one works
> pretty well. I have hacking this kinda thing together before. I
> would love to see the more elegant solution...
>
> dat = dist(100)
> loadct, 0
> contour, dist(100), /fill, nlevels=20
> mask = dat gt 30 and dat lt 40
> loadct, 12
> contour, mask*100, /over, /fill, nlevels=1
> end
>
> To be more specific on the filled region you might need to specify the
> contours in the original plot so that the colored region falls on top
> of it nicely.
>
> Cheers,
>
> Brian
>
> ------------------------------------------------------------ ---------------------
> Brian Larsen
> Boston University
> Center for Space Physics

Hi Brian,

thanks for the reply.
The method you are suggesting me is the one I was thinking about.
Unfortunately, it does not work as I wish, because the 'mask' is not
coincident with the contours' region. It must be the way the contour
procedure works. The two regions are similar, of course, but the
difference is not acceptable for my plot.

I guess the solution should be a graphical one, in the sense that the
contours produced by the contour procedure should be treated as
polygons, with their coordinates, and then, in some way, their
intersection should be found in this way, not in an analytical way.

I hoped this problem had been solved by someone else, since it sould
be quite useful in this kind of plots...

Stefano
Re: Fill intersection of two contours [message #55461 is a reply to message #55446] Wed, 22 August 2007 08:50 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Brian Larsen writes:

> While I am sure there is a much more elegant solution this one works
> pretty well. I have hacking this kinda thing together before. I
> would love to see the more elegant solution.

I'm pretty sure a more elegant solution would involve the
ISOCONTOUR command, but actually writing the darn thing
is more in the nature of a research project than a friendly
conversation in a newsgroup. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Fill intersection of two contours [message #55462 is a reply to message #55461] Wed, 22 August 2007 08:22 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
While I am sure there is a much more elegant solution this one works
pretty well. I have hacking this kinda thing together before. I
would love to see the more elegant solution...

dat = dist(100)
loadct, 0
contour, dist(100), /fill, nlevels=20
mask = dat gt 30 and dat lt 40
loadct, 12
contour, mask*100, /over, /fill, nlevels=1
end

To be more specific on the filled region you might need to specify the
contours in the original plot so that the colored region falls on top
of it nicely.

Cheers,

Brian






------------------------------------------------------------ ---------------------
Brian Larsen
Boston University
Center for Space Physics
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: SOS with Idl
Next Topic: Pson and Psoff with xyouts

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:54:09 PDT 2025

Total time taken to generate the page: 0.00418 seconds