;----- aademo.pro = Demo plot using the aa routines ------- ; R. Sterner, 2002 Jul 23 pro aademo, antialias=anti ;---------------------------------------- ; Use the aa* routines to do graphics. ; Add a flag for antialiasing, test ; with no antialiasing, make final ; plot with antialiasing. ;---------------------------------------- ;--- Init graphics in case of first plot ------ window,xs=50,ys=50,/pix erase wdelete ;------ Antialias switch ------------- if n_elements(anti) eq 0 then anti=0 noaa = 1-anti ;------ Plot parameters ---------- c_wht = tarclr(255,255,255) c_blk = tarclr(0,0,0) c_red = tarclr(255,0,0) c_pnk = tarclr(255,200,200) c_brn = tarclr(/hsv,30,.6,.6) c_yel = tarclr(255,255,150) c_grn = tarclr(0,150,0) c_blu = tarclr(0,0,255) pos = [.15,.15,.95,.85] tt = 'Demo plot: '+ $ (['with no antialiasing','with antialiasing'])(anti) tx = 'Sample Number' ty = 'Value' txt = 'Demo text' txt2 = 'Small text' csz = 2 ;------ Make data ------------------- x = maken(0,100,101) y = makey(101,7,seed=1,/per) k = 5 r = randomu(k,101)*2-1 in = makei(5,95,5) ;------ Make plot ------------------- erase, c_wht aaplot,x,y,pos=pos,col=c_blk,title=tt,xtitle=tx,ytitle=ty, $ charsize=csz, noaa=noaa ;------- Envelope ------------------- aaplotp,x,1.05*y,col=c_red, /clip, noaa=noaa aaplotp,x,0.95*y,col=c_blu, /clip, noaa=noaa ;-------- Points -------------------- aapoint,x(in),y(in)+r(in)*.15,col=c_yel,ocol=c_grn, $ thick=1, size=2,/clip,sides=37,noaa=noaa aapoint,x(in+1),y(in+1)+r(in+1)*.15,col=c_pnk,ocol=c_blu, $ thick=1, size=2,/clip,sides=4, noaa=noaa ;------- Text ------------------------- aatext, 20, .2, txt, align=.5, chars=3, col=c_brn, $ charthick=3, noaa=noaa aatext, 20, .1, txt2, align=.5, chars=.75, col=c_blk, $ noaa=noaa end