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

Home » Public Forums » archive » Re: density color schemes in IDL8 scatterplots
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: density color schemes in IDL8 scatterplots [message #80755] Wed, 11 July 2012 12:56
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> Hmmm.... will this be like that Seinfeld episode where he has to endorse lots of cheques each written for about 5¢?

Probably less than that if I am going to make any
money myself. ;-)

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.")
Re: density color schemes in IDL8 scatterplots [message #80756 is a reply to message #80755] Wed, 11 July 2012 12:36 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
On 07/11/12 15:11, David Fanning wrote:
> Paul van Delst writes:
>
>> There's no need - I used Coyote Graphics (and your book) to do it first so I knew what was possible and what it could
>> look like. That, quite literally, took about an hour... and most of that time was spent re-reading your chapters on
>> image display, colours, colorbars etc. Writing the code was trivial.
>
> Yikes! Amazon just placed an other for more books
> in the middle of the week. Can't remember when that
> last happened. Where can I send your commission check?

Hmmm.... will this be like that Seinfeld episode where he has to endorse lots of cheques each written for about 5�?

:o)
Re: density color schemes in IDL8 scatterplots [message #80757 is a reply to message #80756] Wed, 11 July 2012 12:11 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> There's no need - I used Coyote Graphics (and your book) to do it first so I knew what was possible and what it could
> look like. That, quite literally, took about an hour... and most of that time was spent re-reading your chapters on
> image display, colours, colorbars etc. Writing the code was trivial.

Yikes! Amazon just placed an other for more books
in the middle of the week. Can't remember when that
last happened. Where can I send your commission check?

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.")
Re: density color schemes in IDL8 scatterplots [message #80761 is a reply to message #80757] Wed, 11 July 2012 10:10 Go to previous message
patrickdgriffiths is currently offline  patrickdgriffiths
Messages: 2
Registered: July 2012
Junior Member
Thank you Paul, that is pretty much exactly what I meant. Will try that out soon..
Re: density color schemes in IDL8 scatterplots [message #80764 is a reply to message #80761] Wed, 11 July 2012 09:38 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> And I'm still struggling with the $^@&#* colourbar in function graphics. When I display it horizontally, everything is
> great. When I display it vertically, the function suddenly decides to ignore my TICKNAME labels and just use the byte
> values of the image.... except for the first tick - that one is labelled correctly. Argh!

I wouldn't worry too much about it. I think it is
still broken for doing most scientific work, and will
be until they detach from a "target" in IDL 9.3. (Assuming
they have any users left, of course.)

You can see my frustrations with the IDL 8.2 color bar
in my comments to Mark Piper's blog article here:

http://idldatapoint.com/2012/06/28/discrete-colorbar-in-new- graphics/

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.")
Re: density color schemes in IDL8 scatterplots [message #80765 is a reply to message #80764] Wed, 11 July 2012 09:32 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hello,

On 07/11/12 12:04, David Fanning wrote:
> Paul van Delst writes:
>
>> I do think this is a rather obtuse way of displaying an image with useful, numbered axes and I was going to post to this
>> newsgroup on how to do this in a "better" way. Well, a more intuitive way at least.
>>
>> I think the image should be "axis-aware" so the user doesn't have to dick around with the whole CONVERTCOORD thing. And
>> it may be that there is a way to do that.... but I sure as hell couldn't find out how from the IDL documentation.
>
> I'll make up something intuitive for you this afternoon in
> Coyote Graphics, Paul. ;-)

There's no need - I used Coyote Graphics (and your book) to do it first so I knew what was possible and what it could
look like. That, quite literally, took about an hour... and most of that time was spent re-reading your chapters on
image display, colours, colorbars etc. Writing the code was trivial.

Then, because I'm a stubborn masochistic procrastinator, I duplicated the effort in the new function graphics. THAT took
about 4 days (and it would've taken much much longer if not for your article on function graphics colourbar display on
your webpage).

And I'm still struggling with the $^@&#* colourbar in function graphics. When I display it horizontally, everything is
great. When I display it vertically, the function suddenly decides to ignore my TICKNAME labels and just use the byte
values of the image.... except for the first tick - that one is labelled correctly. Argh!

<...deep breathing...counting to 10....>

Anyhoo...

cheers,

paulv
Re: density color schemes in IDL8 scatterplots [message #80766 is a reply to message #80765] Wed, 11 July 2012 09:04 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> I do think this is a rather obtuse way of displaying an image with useful, numbered axes and I was going to post to this
> newsgroup on how to do this in a "better" way. Well, a more intuitive way at least.
>
> I think the image should be "axis-aware" so the user doesn't have to dick around with the whole CONVERTCOORD thing. And
> it may be that there is a way to do that.... but I sure as hell couldn't find out how from the IDL documentation.

I'll make up something intuitive for you this afternoon in
Coyote Graphics, Paul. ;-)

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.")
Re: density color schemes in IDL8 scatterplots [message #80767 is a reply to message #80766] Wed, 11 July 2012 08:58 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hello,

On 07/11/12 10:22, patrickdgriffiths@gmail.com wrote:
> Hi,
>
> does anyone know if there is any way to use density color schemes for scatterplots using the new IDL8 PLOT functions?
> As this is a standard in ENVI scatterplot visualization, I would be surprised if it was not possible using IDL8
> graphics. I could not find anything so far, however... Thanks,

I will assume you mean a density map, or pdf, when you say "density color scheme". If not, ignore the following.

I recently had to do just this.

After creating a graphics window, referenced in a structure as gData.wref, and my own RGB colour table, referenced in an
array called "rgb_table", this is how I display the image:

; Compute the 2-D histogram for x-y scatterplot data
qc_nbc_hist_2d = HIST_2D(x, y, BIN1=x_binsize, BIN2=y_binsize, $
MIN1=x_min, MAX1=x_max, $
MIN2=y_min, MAX2=y_max)

; Determine the x- and y-axis vectors
hist_info = SIZE(qc_nbc_hist_2d, /STRUCTURE)
n_x = hist_info.DIMENSIONS[0]
n_y = hist_info.DIMENSIONS[1]
x_locations = x_min + FINDGEN(n_x)*x_binsize
y_locations = y_min + FINDGEN(n_y)*y_binsize


; Display the axes for the 2-D histogram image
pi = PLOT( [x_locations[0], x_locations[n_x-1]], [y_locations[0], y_locations[n_y-1]], $
/NODATA, $
TITLE='insert title here', $
XTITLE='insert xtitle here', $
YTITLE='insert ytitle here', $
CURRENT=gData.wref )


; Determine scaling factors for image
result = pi.CONVERTCOORD( pi.xrange, pi.yrange, /DATA, /TO_DEVICE )
dx=result[0,1]-result[0,0]
dy=result[1,1]-result[1,0]


; Display scaled image
im = IMAGE( CONGRID(qc_nbc_hist_2d, dx, dy, /CENTER), $
LINDGEN(dx), $
LINDGEN(dy), $
AXIS_STYLE=0, $
RGB_TABLE=rgb_table, $
CURRENT=gData.wref )


; Ensure the axes are visible over image
pi.Order, /BRING_TO_FRONT

Here's an example of the output:
http://ftp.emc.ncep.noaa.gov/jcsda/CRTM/amsua-ch1.png
The left-most plots are the regular scatterplots. The rightmost plots are the corresponding 2-D density map.

I do think this is a rather obtuse way of displaying an image with useful, numbered axes and I was going to post to this
newsgroup on how to do this in a "better" way. Well, a more intuitive way at least.

I think the image should be "axis-aware" so the user doesn't have to dick around with the whole CONVERTCOORD thing. And
it may be that there is a way to do that.... but I sure as hell couldn't find out how from the IDL documentation.

cheers,

paulv
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: include COI on wavelet plots using toolkit
Next Topic: Re: Google Static Maps in IDL

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

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

Total time taken to generate the page: 0.00677 seconds