FUNCTION hist,f,scale=scale,n=n max=max(f,min=min) if n_elements(n) eq 0 then n=100 bin=(max-min)/n ; print,'min =',min,' max =',max h=histogram(f,bin=bin) scale=min+bin*findgen(n_elements(h)) return,h end PRO ploghist,f,title=title,xtitle=xtitle,n=n,chars=chars,oplt=oplt,line=line,$ psym=psym,xrange=xrange,yrange=yrange,ytitle=ytitle,prob=prob ; histogram y=hist(f,scale=x,n=n) ; parameters if n_elements(title) eq 0 then title=' ' if n_elements(xtitle) eq 0 then xtitle=' ' if n_elements(ytitle) eq 0 then ytitle=' ' if n_elements(chars) eq 0 then chars=1.0 if n_elements(line) eq 0 then line=0 if n_elements(psym) eq 0 then psym=10 if n_elements(xrange) eq 0 then xrange=[min(x),max(x)] ; probability if keyword_set(prob) then y=y/float(total(y))*n/abs(x(n)-x(0)) ; if n_elements(prob) ne 0 then begin ; s=size(f) ; if(s(0) eq 1) then n=s(1)*1. ; if(s(0) eq 2) then n=s(1)*1.*s(2) ; if(s(0) eq 3) then n=s(1)*1.*s(2)*1.*s(3) ; if(s(0) eq 4) then n=s(1)*1.*s(2)*1.*s(3)*1.*s(4) ; y=y/n ; endif if n_elements(yrange) eq 0 then yrange=[min(y),max(y)] ; plot if n_elements(oplt) eq 0 then begin ; plot_oo,x,y,title=title,xtitle=xtitle,chars=chars,line=line,psym=psym,$ plot_io,x,y,title=title,xtitle=xtitle,chars=chars,line=line,psym=psym,$ xrange=xrange,yrange=yrange,ytitle=ytitle endif else begin oplot,x,y,psym=psym,line=oplt endelse END