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

Home » Public Forums » archive » cgHistoplot -- input histogram results?
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
cgHistoplot -- input histogram results? [message #86326] Sun, 27 October 2013 10:15 Go to next message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
I have data from a few hundred files histogrammed and saved. I would like to use cgHistoplot to display it. Is it possible to take the results of Histogram (or cgHistogram) and use them as inputs to cgHistogram? I see the keyword HISTDATA, but it is an output.

Thanks
Re: cgHistoplot -- input histogram results? [message #86327 is a reply to message #86326] Sun, 27 October 2013 11:07 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Matthew Argall writes:

> I have data from a few hundred files histogrammed and saved. I would like to use cgHistoplot to display it. Is it possible to take the results of Histogram (or cgHistogram) and use them as inputs to cgHistogram? I see the keyword HISTDATA, but it is an output.

It is not really possible to do this because so much of what is required
to draw the plot (data ranges, binsize, etc.) comes from the data itself
and not from the actual histogram.

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.")
Re: cgHistoplot -- input histogram results? [message #86328 is a reply to message #86327] Sun, 27 October 2013 11:10 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> It is not really possible to do this because so much of what is required
> to draw the plot (data ranges, binsize, etc.) comes from the data itself
> and not from the actual histogram.

Maybe "not possible" is the wrong way to say it. It would be possible if
the information required to draw the plot were provided, but this will
make some keywords required parameters, rather than the normal optional
parameters, etc. It will get VERY ugly and not at all the Coyote style.
:-)

Of course, if YOU wanted to do it, I couldn't stop you. :-)

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.")
Re: cgHistoplot -- input histogram results? [message #86336 is a reply to message #86326] Mon, 28 October 2013 09:17 Go to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
I have to do this before - basically, I fake the original data set, based on inputs from the original histogram. Basically, I replicate the middle of each bin to match the histogram value (to stay away from the razor's edge):

binSize = 5.0
minVal = 0.0
h=HISTOGRAM(data, BIN=binSize, MIN=minVal) ;original histogram

nData = TOTAL(h)
nHisto = N_ELEMENTS(h)

middleBins = FINDGEN(nHisto)*binSize/2+minVal

fakeData = FLTARR(nData)

FOR i=0, nHisto-1 DO BEGIN
IF h[i] EQ 0 THEN CONTINUE
IF i EQ 0 THEN startInd = 0 ELSE startInd = TOTAL(h[0:i-1])
stopInd = TOTAL(h[0:i])-1

fakeData[ startInd : stopInd ] = REPLICATE(middleBins[i], h[i])

ENDFOR

(There's plenty room for improvement in this code....not enough coffee yet :-) )

You could then throw fakeData at cgHistoplot. I've only had to do this a couple of times - so, the time penalty for duplicating the histogram calculation wasn't important (enough). I suppose as long as the data isn't too finely binned, it would work fine....
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Using Y_SCROLL_SIZE and COLUMN=8 on Mac widgets
Next Topic: Overplot cgplots in graphics window

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

Current Time: Wed Oct 08 13:55:02 PDT 2025

Total time taken to generate the page: 0.00460 seconds