1 | PRO colorbarn,xpo, ypo, length, height, mindat, maxdat, leveling,nlevels,levels,colors, format, cs |
---|
2 | ; does a colorbar |
---|
3 | ; v1.0 by Ralph Timmermann, UCL-ASTR, 2002 |
---|
4 | ; tag v2.0, Martin Vancoppenolle, June 2nd, 2009 |
---|
5 | ;------------------------------------------------------------------------------ |
---|
6 | |
---|
7 | ; diese procedure zeichnet einen farbbalken |
---|
8 | ; folgende parameter muessen gesetzt werden |
---|
9 | ; |
---|
10 | ; xpo,ypo position der linken unteren ecke in Normalkoordinaten |
---|
11 | ; length, height laenge und Hoehe des balkens |
---|
12 | ; mindat,maxdat wertegrenzen des balkens |
---|
13 | ; |
---|
14 | ;------------------------------------------------------------------------------ |
---|
15 | |
---|
16 | ; create the bar |
---|
17 | ncol=nlevels-1 ; ok |
---|
18 | bar=INTARR(ncol,2) |
---|
19 | bar(*,0)=REFORM(colors(0:ncol-1)) |
---|
20 | bar(*,1)=bar(*,0) |
---|
21 | |
---|
22 | ; plot the bar (congrid just expands an array |
---|
23 | TV, CONGRID(bar,ncol*20,10),xpo,ypo,xsize=length,ysize=height,/normal |
---|
24 | |
---|
25 | ; add the black lines and the caption |
---|
26 | PLOT,[0,nlevels],[0,height],xsty=1,ysty=1,/nodata,/noerase,$ |
---|
27 | yticks=1,yticklen=0,ytickv=[0,height],ytickname=[' ',' '],$ |
---|
28 | xticks=nlevels-1,xtickn=string(levels,format=format),$ |
---|
29 | position=[xpo,ypo,xpo+length,ypo+height],$ |
---|
30 | /normal,xticklen=0.5,color=000, charsize=cs |
---|
31 | |
---|
32 | END |
---|