; ; plots a color bar ; pro colorbarm,dataname,data,dmax,dmin,cb_title,px,py,sx,sy dmax=float(dmax) dmin=float(dmin) image=bytscl(data,max=dmax,min=dmin) min_image=min(image) max_image=max(image) ; ; Create an array 2 wide with a length equal to the range of the data plotted ; cb_arr=fltarr(2,max_image-min_image+1) for j=0.0,max_image-min_image do begin cb_arr(*,j)=dmin+((dmax-dmin)/(max_image-min_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) for j=0,max_image-min_image do cb_img(*,j)=min_image+j 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-min_image]],$ ystyle=1,/device,charsize=1.9,ytitle=cb_title return end