Re: Fill intersection of two contours [message #55446] |
Thu, 23 August 2007 02:23 |
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  |
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  |
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
|
|
|