Re: Overplot data on a 2d histogram [message #73179] |
Wed, 27 October 2010 18:06 |
jeffnettles4870
Messages: 111 Registered: October 2006
|
Senior Member |
|
|
On Oct 27, 8:29 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Oct 27, 10:11 pm, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>> I mostly use IDL to write custom routines for ENVI, so I don't usually
>> have to use IDL's plotting routines very much. But I'm slowly but
>> surely developing a need to plot some 2d histograms for a couple
>> projects i'm working on. I can make the 2d histograms with HIST_2D()
>> (or J.D.'s HIST_ND) with no trouble. And I can also display the
>> resulting image with no trouble, even with axes on the image if i'd
>> like. But the axes would have pixel coordinates as values, where i'd
>> like the axes to have values of the data that went into the hist_2d.
>> And then I'd like to be able to overplot stuff (more points,
>> polygons,etc.) on the plot, in the dataspace of the original data of
>> course (not the pixel coords of the histogram image). This is a more
>> complicated plot than i'm used to making :( Can anyone give me some
>> pointers about the best way to approach this? I really don't even
>> care which graphics system - whatever's simplest! :)
>
> Sounds like you might want something like
>
> IDL> imd=dist(200);make up some data to display
> IDL> im=image(imd,
> 5.75+dindgen(200)*0.0093,-17.+dindgen(200)*0.00595,axis_styl e=2)
>
> The first argument to image is the 2D array with the data, the second
> is a 1D array with the x location of each column, and the third is a
> 1D array with the y location of each line.
Perfect! So simple! I'd spent all my time pouring over the help for
the PLOT() function, didn't even think to look at IMAGE() first :(
Thanks Paulo!
|
|
|
Re: Overplot data on a 2d histogram [message #73180 is a reply to message #73179] |
Wed, 27 October 2010 17:29  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Oct 27, 10:11 pm, "Jeff N." <jeffnettles4...@gmail.com> wrote:
> I mostly use IDL to write custom routines for ENVI, so I don't usually
> have to use IDL's plotting routines very much. But I'm slowly but
> surely developing a need to plot some 2d histograms for a couple
> projects i'm working on. I can make the 2d histograms with HIST_2D()
> (or J.D.'s HIST_ND) with no trouble. And I can also display the
> resulting image with no trouble, even with axes on the image if i'd
> like. But the axes would have pixel coordinates as values, where i'd
> like the axes to have values of the data that went into the hist_2d.
> And then I'd like to be able to overplot stuff (more points,
> polygons,etc.) on the plot, in the dataspace of the original data of
> course (not the pixel coords of the histogram image). This is a more
> complicated plot than i'm used to making :( Can anyone give me some
> pointers about the best way to approach this? I really don't even
> care which graphics system - whatever's simplest! :)
Sounds like you might want something like
IDL> imd=dist(200);make up some data to display
IDL> im=image(imd,
5.75+dindgen(200)*0.0093,-17.+dindgen(200)*0.00595,axis_styl e=2)
The first argument to image is the 2D array with the data, the second
is a 1D array with the x location of each column, and the third is a
1D array with the y location of each line.
|
|
|