Re: Histogram problem [message #93995 is a reply to message #93990] |
Thu, 15 December 2016 06:16  |
Markus Schmassmann
Messages: 129 Registered: April 2016
|
Senior Member |
|
|
On 12/14/2016 05:10 AM, priyamalik484@gmail.com wrote:
> I have two histograms, I want to overplot both, but y-axis scaling of
> these two histograms are very different such that when I am
> overploting them the feature of one is completely getting suppressed.
> So someone advised me plot normalized histograms, can any one suggest
> me how to do that in IDL??
Hi,
h1=histogram(...)
h2=histogram(...)
hn1=h1/total(h1)
hn2=h2/total(h2)
b1=barplot(hn1,index=0,nbars=2)
b2=barplot(hn2,index=1,nbars=2,fill_color='b',overplot=b1)
for more details on formating, see
http://www.harrisgeospatial.com/docs/barplot.html
or alternatively if you don't need the normalization and just want to
fit both histograms with appropriate scales into the same graphics
b3=barplot(h1,index=0,nbars=2,yrange=[0,max(h1)*1.1])
b4=barplot(h2,index=1,nbars=2,yrange=[0,max(h2)*1.1], $
overplot=b3,fill_color='b')
a2=axis('y',target=b4,location=right,textpos=1,color='b',sho wtext=1)
for details on additional axes, see
http://www.harrisgeospatial.com/docs/AXIS.html
Both versions are not tested, but should at least give you an idea how
to proceed.
Good luck, Markus
|
|
|