
;+
;   This shows how to make semi-transparent boxes for a plot.
;-

x=findgen(101)/100.*2.*!pi
y=sin(x)

bgcolor='white'
color='black'

w=window(dimension=[700,500],background_color=bgcolor)

th=2
fs=14

p=plot([min(x),max(x)],[min(y),max(y)],/nodata, /current, $
       xcolor=color, $
       ycolor=color, $
       transparency=0, $
       xthick=th, $
       ythick=th, $
       font_size=fs, $
       xstyle=1, $
       xtitle='X', $
       ytitle='SIN(X)', $
       xminor=1, $
       xticklen=0.015, $
       yticklen=0.015, $
       position=[0.14,0.14,0.97,0.97])

x0=2 & x1=4.5
y0=-0.3 & y1=0.3
 
box1=plot(/overplot,[x0,x1,x1,x0,x0],[y0,y0,y1,y1,y0], $
          fill_background=1, fill_color='khaki',linestyle='none',  $
          fill_transparency=50)

x0=3.5 & x1=5
y0=-0.9 & y1=0.6
box2=plot(/overplot,[x0,x1,x1,x0,x0],[y0,y0,y1,y1,y0], $
          fill_background=1, fill_color='light blue',linestyle='none',  $
          fill_transparency=50)

x0=3 & x1=4
y0=-0.4 & y1=-0.2
box3=plot(/overplot,[x0,x1,x1,x0,x0],[y0,y0,y1,y1,y0], $
          fill_background=1, fill_color='light salmon',linestyle='none',  $
          fill_transparency=50)

q=plot(/overplot,x,y, $
       color='blue',$
       thick=th+1)

w.save,'exercise6.png',resolution=97

END
