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

Home » Public Forums » archive » Re: cgHistoPlot - locations and histdata keywords?
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: cgHistoPlot - locations and histdata keywords? [message #79630] Fri, 16 March 2012 14:45
BLesht is currently offline  BLesht
Messages: 89
Registered: March 2007
Member
On Friday, March 16, 2012 3:43:49 PM UTC-5, David Fanning wrote:
> Barry Lesht writes:
>
>> Hi - I'm having problems using cgHistoPlot in a re-sizable graphics window.
>>
>> For example,
>>
>> cgWindow, xwsize=xSize, ywsize=ySize
>> cgWindow, 'cgHistoPlot', data, binsize=1., LOCATIONS=locs, HISTDATA=hists, /LoadCmd
>> HELP, locs, hists
>> cgWindow, /ExecuteCmd
>>
>> Yields,
>> LOCS UNDEFINED = <Undefined>
>> HISTS UNDEFINED = <Undefined>
>>
>> There is an old post referring to what looks like a similar problem; is there a simple way around it?
>
> The simple way to work around it, of course, is to first
> do the command in a regular display window, where there
> is no issue in returning keywords. I would use a pixmap
> window, probably, if I didn't want anyone to see it:
>
> IDL> data = cgDemoData(7)
> IDL> cgDisplay, /Pixmap, /Free
> IDL> cgHistoPlot, data, binsize=1., LOCATIONS=locs, HISTDATA=hists
> IDL> WDelete, !D.Window
> IDL> Help, locs, hists
> LOCS INT = Array[256]
> HISTS LONG = Array[256]
>
> Then you can proceed normally with the values you need.
>
> Cheers,
>
> David
>
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thue. ("Perhaps thos speakest truth.")

Hi David,

OK, I think I get it. Essentially I do it twice; the second time I can use the values returned by the first call to cgHistoPlot to do what I want, which is to annotate the histogram created by cgHistoPlot with the number of elements in each bin. Since I'm not using passed keywords in the second call, I can put it into a cgWindow, and then use cgText to do the annotation.

Thanks, Barry
Re: cgHistoPlot - locations and histdata keywords? [message #79632 is a reply to message #79630] Fri, 16 March 2012 13:43 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Barry Lesht writes:

> Hi - I'm having problems using cgHistoPlot in a re-sizable graphics window.
>
> For example,
>
> cgWindow, xwsize=xSize, ywsize=ySize
> cgWindow, 'cgHistoPlot', data, binsize=1., LOCATIONS=locs, HISTDATA=hists, /LoadCmd
> HELP, locs, hists
> cgWindow, /ExecuteCmd
>
> Yields,
> LOCS UNDEFINED = <Undefined>
> HISTS UNDEFINED = <Undefined>
>
> There is an old post referring to what looks like a similar problem; is there a simple way around it?

The simple way to work around it, of course, is to first
do the command in a regular display window, where there
is no issue in returning keywords. I would use a pixmap
window, probably, if I didn't want anyone to see it:

IDL> data = cgDemoData(7)
IDL> cgDisplay, /Pixmap, /Free
IDL> cgHistoPlot, data, binsize=1., LOCATIONS=locs, HISTDATA=hists
IDL> WDelete, !D.Window
IDL> Help, locs, hists
LOCS INT = Array[256]
HISTS LONG = Array[256]

Then you can proceed normally with the values you need.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Cumulative max() in *arbitrary* dimension?
Next Topic: how to extend a vector from size A to size B, (A<B) without "damage" the data in A

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

Current Time: Wed Oct 08 13:54:31 PDT 2025

Total time taken to generate the page: 0.14247 seconds