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

Home » Public Forums » archive » Histogram problem
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
Histogram problem [message #93990] Tue, 13 December 2016 20:10 Go to next message
priyamalik484 is currently offline  priyamalik484
Messages: 7
Registered: December 2016
Junior Member
Hello all,

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??
Re: Histogram problem [message #93995 is a reply to message #93990] Thu, 15 December 2016 06:16 Go to previous message
Markus Schmassmann is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: dialog_pickfile crashing IDLDE
Next Topic: About "Invalid HDF file or filename" using hdf_sd_start on a valid HDF file due to loop through too many hdf files

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

Current Time: Wed Oct 08 07:23:38 PDT 2025

Total time taken to generate the page: 0.00482 seconds