Re: cghistoplot: getting histdata values without any plotting? [message #83206] |
Mon, 18 February 2013 21:58 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Tim B writes:
> After posting this I realised it would be easiest to just write my own
function, so all good now. Are their different approaches people take to
this problem?
I would probably just calculate the three histograms (with the Histogram
command) and find the maximum value.
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: getting histdata values without any plotting? [message #83207 is a reply to message #83206] |
Mon, 18 February 2013 20:01  |
timmyb89
Messages: 4 Registered: October 2012
|
Junior Member |
|
|
After posting this I realised it would be easiest to just write my own function, so all good now. Are their different approaches people take to this problem?
On Tuesday, February 19, 2013 2:01:15 PM UTC+11, Tim B wrote:
> Hi everyone,
>
>
>
> I'm using cghistoplot to make a histogram with three data sets (arrays).
>
>
>
> One problem is I'm not sure which of the sets will have the largest (tallest) histogram. That is, if I plot one set, then overplot the remaining two sets, some of the overplotted histograms might exceed the maximum y range calculated by plotting the first set.
>
>
>
> What I would like to be able to do is call cghistoplot for each data set, but without any plotting or anything taking place, solely to to retrieve the histdata keyword. I could then find the maximum y value of all of the histograms and use this to construct the final histogram.
>
>
>
> It would go something like this (ignoring binsize and mininput keywords etc.):
>
>
>
> cghistoplot,a,histdata=data1
>
> cghistoplot,b,histdata=data2
>
> cghistoplot,c,histdata=data3
>
>
>
> ymax=max([data1,data2,data3])
>
>
>
> cghistoplot,a,yrange=[0,ymax]
>
> cghistoplot,b,/oplot
>
> cghistoplot,c,/oplot
>
>
>
>
>
> Although in the first 3 cghistoplot calls I don't want it to do any plotting, I only need to retrieve the histdata values. Is there a clever way to do this or am I missing something? I've tried using the /nodata keyword but it doesn't help. I'm stuck wanting to do a multiplot of overplotted histograms (looping through different bin sizes etc.).
>
>
>
> Thanks, Tim
|
|
|