pro plotfocus,sharp,prn,title=title

;printer=['lp '] ;print to: HPLJ4 on mdipfs
printer=['lps20 ','lp ','lp -dmdilj4 '] ;print to: LPS20, LN03 or HPLJ4
paw=['P 125','P 89','P 17','P 53'] 
if n_elements(prn) eq 0 then prn=0
if NOT keyword_set(title) then title=' '

!y.style=16
!p.multi=[0,2,2]
fx1=min(sharp(0,0:35),max=fx2)
fy1=min(sharp(1,0:35),max=fy2)
hx1=min(sharp(0,36:71),max=hx2)
hy1=min(sharp(1,36:71),max=hy2)
;fx1=min(sharp(0,0:8),max=fx2)
;fy1=min(sharp(1,0:8),max=fy2)
;hx1=min(sharp(0,9:17),max=hx2)
;hy1=min(sharp(1,9:17),max=hy2)

if (prn gt 0) then begin
  print,'Generating & printing "idl.ps"'
  set_plot,'ps'
  device,/landscape
endif

plot,indgen(9)+1,sharp(0,0:8),tit='FULL DISK focus in X',$
  xtit='Focus position(steps)',ytit='Normalized sharpness',$
  xrange=[1,9],yrange=[fx1,fx2]
for i=1,3 do oplot,indgen(9)+1,sharp(0,0+i*9:8+i*9),linestyle=i

plot,indgen(9)+1,sharp(1,0:8),tit='FULL DISK focus in Y',$
  xtit='Focus position(steps)',ytit='Normalized sharpness',$
  xrange=[1,9],yrange=[fy1,fy2]
for i=1,3 do oplot,indgen(9)+1,sharp(1,0+i*9:8+i*9),linestyle=i

;plot,indgen(9)+1,sharp(0,9:17),tit='HI-REZ focus in X',$
plot,indgen(9)+1,sharp(0,36:44),tit='HI-REZ focus in X',$
  xtit='Focus position(steps)',ytit='Normalized sharpness',$
  xrange=[1,9],yrange=[hx1,hx2]
for i=1,3 do oplot,indgen(9)+1,sharp(0,36+i*9:44+i*9),linestyle=i

;plot,indgen(9)+1,sharp(1,9:17),tit='HI-REZ focus in Y',$
plot,indgen(9)+1,sharp(1,36:44),tit='HI-REZ focus in Y',$
  xtit='Focus position(steps)',ytit='Normalized sharpness',$
  xrange=[1,9],yrange=[hy1,hy2]
for i=1,3 do oplot,indgen(9)+1,sharp(1,36+i*9:44+i*9),linestyle=i

xyouts,/norm,0,1.05,title
for i=0,3 do begin
  plots,/norm,[0+i*0.25,0.1+i*0.25],[-.05,-0.05],linestyle=i
  xyouts,/norm,0.12+i*0.25,-.05,paw(i)
endfor

if (prn gt 0) then begin
  device,/close
  set_plot,'x'
  spawn,printer(prn-1)+'idl.ps'
endif
!p.multi=0
print,'Done !'

end