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

Home » Public Forums » archive » Smooth Contour Plot
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
Smooth Contour Plot [message #78162] Tue, 01 November 2011 03:24 Go to next message
Sofie Fehlmann is currently offline  Sofie Fehlmann
Messages: 5
Registered: November 2011
Junior Member
Dear all,

I have just started using IDL and have now a question:

How can plot smooth 2d Plots? I have tried the following:

c1 = contour(data,x,y,rgb_table=34,/fill,n_levels=55)

The result is a 2D plot which looks like a surrealistic picture of
art. If I use the function min_curve_surf(data), the program crashes.
If I increase the number of levels, the result looks even worse.

Is there a way to create a colored 2D plot with smooth color
variations?
Re: Smooth Contour Plot [message #78254 is a reply to message #78162] Tue, 01 November 2011 08:16 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Sofie Fehlmann writes:

> I finally found the solution.
>
> Maybe I didn't state the problem very well. I have a matrix with data
> points. What I wanted to do is the following: Each point should have a
> certain color such that I get a smooth picture. Somehow, when I
> changed the number of levels (n_levels), the color scheme just started
> from the beginning.
>
> The following pattern worked finally:
>
> levels = 256
> step = (Max(data) - Min(data)) / levels
> userLevels = IndGen(levels) * step + Min(data)
>
> contour(data,x,y,rgb_table=33,/
> fill,c_value=userlevels,c_color=indgen(levels)+1)
>
> Doing so, I have created an array of data-steps. Further, the c_color
> command defines the corresponding color.

Ah, yes, that will smooth things out. Of course, so
will displaying your data as an image. ;-)

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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Smooth Contour Plot
Next Topic: UTM Map Projection Produces Incorrect Results

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

Current Time: Wed Oct 08 11:40:44 PDT 2025

Total time taken to generate the page: 0.00601 seconds