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

Home » Public Forums » archive » New 2D Scatter Plot Program
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
New 2D Scatter Plot Program [message #78922] Wed, 11 January 2012 11:15
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

I surprising number of people have been looking on my web page
lately for information on "scatter plots". To that end, I
have created a new 2D scatter plot program, named
cgScatter2D, for producing two-dimensional scatter plots.

You can find the code here:

http://www.idlcoyote.com/programs/cgscatter2d.pro

And you can find the on-line help for the program here:

http://www.idlcoyote.com/idldoc/cg/cgscatter2d.html

This program works very much like cgPlot, with the same
keywords, etc., but in addition it calculates the Pearson
correlation coefficient and fits a straight line though
the data. The correlation coefficient and the fitting
equation are displayed on the plot itself by default.
There are LOTS of keywords, so you can pretty much
decide what you want the final plot to look like.

Here is an example.

data_1 = cgDemoData(1)+ RandomU(seed, 101) * 10
data_2 = cgDemoData(1)+ RandomU(seed, 101) * 10
cgScatter2D, data_1, data_2, SymColor='navy', /Grid

Like all Coyote Graphics routines, you can display this
in a resizeable graphics window:

cgScatter2D, data_1, data_2, SymColor='navy', /Grid, /Window

Or, send the results directly to a PNG or some other
type of raster output:

cgScatter2D, data_1, data_2, SymColor='navy', /Grid, $
Output='scatter.png'

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: widget_slider cross platform (from windows to Mac)
Next Topic: Re: widget_slider cross platform (from windows to Mac)

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

Current Time: Wed Oct 08 19:28:44 PDT 2025

Total time taken to generate the page: 0.00570 seconds