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

Home » Public Forums » archive » Re: Contour shading (patterns)
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: Contour shading (patterns) [message #2221] Mon, 20 June 1994 10:36
sterne is currently offline  sterne
Messages: 15
Registered: March 1992
Junior Member
>>>> > "Andy" == Andrew F. Loughe <andy@pong.gsfc.nasa.gov> asks:

|> I post this about every 3 months... does anyone yet have a solution?
|>
|> The problem is to produce a simple contour plot where, instead of filling
|> between the contour lines with different colors, one fills between the
|> contour lines with a specified dot or line pattern.
|>


>>>> > "David" == David Landers <landers@tsunami.dseg.ti.com> responds:

David> Get PV-WAVE. :) Use POLYCONTOUR, Pattern=whatever

David> Of course, POLYCONTOUR doesn't handle open contours, so you have
David> to use the 'surround your data' trick (v4.2 User's Guide,
David> Chapter 4).

David> POLYCONTOUR does have some trouble with some kinds of data (due
David> to assumptions it makes about which contour regions are "on top"
David> or something like that.


Of course, IDL has polycontour as well, so if you can get at the
contours, you can use this approach there as well.

A while ago, I posted a hacked version of polycontour for PV-Wave and
IDL which allows a choice of user-specified fill pattern, and which
closes open contours without having to resort to the data-distorting
"surround your data" trick. It also fills the contours in the correct
order so the above mentioned "trouble with some kinds of data" is
eliminated (e.g. it will plot a volcano-like function without losing the
dip in the middle). If anybody is interested in a copy, send me e-mail.
If there is enough interest, I'll post it again.

Phil
--
------------------------------------------------------------ ---------
Philip Sterne | sterne@dublin.llnl.gov
Lawrence Livermore National Laboratory | Phone (510) 422-2510
Livermore, CA 94550 | Fax (510) 422-7300
Re: Contour shading (patterns) [message #2226 is a reply to message #2221] Fri, 17 June 1994 15:08 Go to previous message
landers is currently offline  landers
Messages: 45
Registered: May 1993
Member
In article <2tq25i$dhs@paperboy.gsfc.nasa.gov>, andy@pong.gsfc.nasa.gov (Andrew F. Loughe) writes:
|> I post this about every 3 months... does anyone yet have a solution?
|>
|> The problem is to produce a simple contour plot where, instead of filling
|> between the contour lines with different colors, one fills between the
|> contour lines with a specified dot or line pattern.
|>

Get PV-WAVE. :) Use POLYCONTOUR, Pattern=whatever

Of course, POLYCONTOUR doesn't handle open contours, so you have to use the
'surround your data' trick (v4.2 User's Guide, Chapter 4).

POLYCONTOUR does have some trouble with some kinds of data (due to assumptions
it makes about which contour regions are "on top" or something like that.

More generally, you could display your data as an image (REBIN, SMOOTH(?),
BYTSCL, TV). I think you could then have some success with making your plot
device dither.... Yuck

Or use "PLOTS, Psym=whatever" on each point in your data, selecting the Psym
based on the data level....

CONTOUR, data, x, y
sym = bytscl(data, top=6)+1 ; use Psyms 1 thru 7
FOR i=0L, N_elements(data)-1 do $
PlOTS, x(i), y(i), Psym=sym(i)

This doesn't exactly _fill_ your contours, but it's a pretty simple approach.
It has the advantage (or disadvantage, depending on your perspective) of
also indicating where your "real" data points are.

Depending on the relative density of data vs. your display, this could be very
ugly, or quite nice. Maybe CONGRID or REBIN data to get more or fewer data
points for the PLOTS loop.... Or pick better patterns and use USERSYM.

I use this technique to make 'image' plots of random data that I don't want to
regrid. Except I use a BYTSCL'd color rather than Psym, and I don't use the
CONTOUR. It's especially handy for checking out raw data, or comparing
gridder results to the ungridded data.

|> "IDL Wizard of the Year" honors to one who has the solution.
|>

No thanks - not qualified. "PV-WAVE wiz" ? maybe....

|> --
|> ,__o Andrew F. Loughe (Mail Code 971)
|> -\_<, NASA Goddard Space Flight Center phone: (301) 286-5899
|> (*)/'(*) Greenbelt, MD 20771 email: andy.loughe@gsfc.nasa.gov


;Dave
Re: Contour shading (patterns) [message #2229 is a reply to message #2226] Fri, 17 June 1994 11:28 Go to previous message
andy is currently offline  andy
Messages: 31
Registered: November 1993
Member
In article <2tsgrh$5im@csnews.cs.Colorado.EDU>, rice@alumni.cs.colorado.edu (Matthew Rice) writes:

> Look up contour in the IDL Reference Manual (pp. 1-44 thru 1-50). The
> following example shows just a few of the keywords available to contour.
>
> z = shift(dist(40), 20, 20)
> z = exp(-(z/10)^2)
> contour, z, c_orientation=[30, 60, 90, 120, 150], nlevel=8,c_thick=2, $
> c_linestyle=[0,2]
>
> -Matt Rice


My mailbox is full of these quotes from the reference manual, but this
method does not provide a visually pleasing set of dot patterns. I need
a good variety of patterns that look appealing in postscript. The above
method does fine for lines, and I solute you for locating it.

--
,__o Andrew F. Loughe (Mail Code 971)
-\_<, NASA Goddard Space Flight Center phone: (301) 286-5899
(*)/'(*) Greenbelt, MD 20771 email: andy.loughe@gsfc.nasa.gov
Re: Contour shading (patterns) [message #2230 is a reply to message #2229] Fri, 17 June 1994 08:52 Go to previous message
rice is currently offline  rice
Messages: 1
Registered: June 1994
Junior Member
> I post this about every 3 months... does anyone yet have a solution?
>
> The problem is to produce a simple contour plot where, instead of filling
> between the contour lines with different colors, one fills between the
> contour lines with a specified dot or line pattern.
>
> "IDL Wizard of the Year" honors to one who has the solution.
>
> --
> ,__o Andrew F. Loughe (Mail Code 971)
> -\_<, NASA Goddard Space Flight Center phone: (301) 286-5899
> (*)/'(*) Greenbelt, MD 20771 email: andy.loughe@gsfc.nasa.gov

Look up contour in the IDL Reference Manual (pp. 1-44 thru 1-50). The
following example shows just a few of the keywords available to contour.

z = shift(dist(40), 20, 20)
z = exp(-(z/10)^2)
contour, z, c_orientation=[30, 60, 90, 120, 150], nlevel=8,c_thick=2, $
c_linestyle=[0,2]

-Matt Rice
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Profiling tools for IDL
Next Topic: IDL and 24 Bits

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

Current Time: Wed Oct 08 19:24:53 PDT 2025

Total time taken to generate the page: 0.14891 seconds