help with scatter plot-like data [message #84885] |
Mon, 17 June 2013 07:00  |
clykou
Messages: 2 Registered: June 2013
|
Junior Member |
|
|
Hi
I'm really out of my depth here with my minimal knowledge on IDL. Basically I'd like to make a color-coded 2D scatter plot, but I'm not sure how to do it.
Here's the thing. I already have values for my x and y axis and I already know that the positions of the scattered points for my z-axis are just the sqrt(x^2+y^2). But I'm not sure how to plot them in 2D.
I tried a dummy array
dummy=fltarr(3,n_elements(dataz))
dummy[0,*]=dataz
dummy[1,*]=xaxis
dummy[2,*]=yaxis
but then I have no idea how to use the plot command to make the scatter plot.
Any help will be very welcome!
Cheers
|
|
|
Re: help with scatter plot-like data [message #84887 is a reply to message #84885] |
Mon, 17 June 2013 07:08   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
clykou@gmail.com writes:
> I'm really out of my depth here with my minimal knowledge on IDL.
Basically I'd like to make a color-coded 2D scatter plot, but I'm not
sure how to do it.
>
> Here's the thing. I already have values for my x and y axis and I already know that the positions of the scattered points for my z-axis are just the sqrt(x^2+y^2). But I'm not sure how to plot them in 2D.
>
> I tried a dummy array
> dummy=fltarr(3,n_elements(dataz))
> dummy[0,*]=dataz
> dummy[1,*]=xaxis
> dummy[2,*]=yaxis
>
> but then I have no idea how to use the plot command to make the scatter plot.
>
You can find over 50 different kinds of plots, including 2D scatter
plots, and the IDL code to produce them, in the Coyote Plot Gallery:
http://www.idlcoyote.com/gallery/index.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
|