; ; plots a color bar ; pro colorbar,dataname,image,dmax,dmin,cb_title,px,py,sx,sy min_image=min(image) if dataname eq 'ReflectivityBestEstimate' or dataname eq 'Reflectivity' then begin min_image=0 endif max_image=max(image) ;also max_histo ; ; Create an array 2 wide with a length equal to the range of the data plotted ; cb_arr=fltarr(2,max_image) for j=0,max_image-1 do begin cb_arr(*,j)=dmin+((dmax-dmin)/(max_image))*j endfor ; ; Create an image array 2 wide with a length equal to the range of the image plotted ; cb_img=bindgen(2,max_image-min_image+1) cb_img1=indgen(max_image-min_image+1) cb_img1[0]=0 cb_img1[max_image-min_image]=0 for j=0,max_image-min_image do cb_img(*,j)=min_image+j for j=0,max_image-min_image do cb_img1(j)=min_image+j ;cb_img1 ;contour, float(cb_arr), [1,2], cb_arr(1,*), /nodata, $ ; xstyle=4, ystyle=1, $ ;no xaxis, forced yaxis ;ytitle=cb_title, $ ;position=[0.0],$;cb_pos, $ ;background=!d.n_colors-1, color=0 tv, congrid(cb_img,(sx/40),sy), px[1]+sx/12, py[0] axis,px[1]+sx/12,py[0],yaxis=0,color=0,yrange=[cb_arr[0,0],cb_arr[0,max_image-1]],$ ystyle=1,/device,charsize=1.9,ytitle=cb_title ;xyouts,px[1]+sx/30,py[0],'sally',color=0,/device ;contour, float(cb_arr), [1,2], cb_arr(1,*), /nodata, /noerase, $ ; xstyle=4, ystyle=1, $ ; ytitle=cb_title, $ ; ;position=cb_pos, $ ; background=!d.n_colors-1, color=0 return end