[2] | 1 | ;+ |
---|
| 2 | ; |
---|
[142] | 3 | ; @file_comments |
---|
| 4 | ; allows to trace the independently from a graph |
---|
[237] | 5 | ; By default, trace a color bar of the same type than the one present in |
---|
| 6 | ; <pro>plt</pro> |
---|
| 7 | ; and <pro>pltz</pro>. |
---|
| 8 | ; If max, min and divisions are not stipulated, then max=sup,min=inf |
---|
[142] | 9 | ; and divisions=div. |
---|
[2] | 10 | ; |
---|
[142] | 11 | ; @categories |
---|
[157] | 12 | ; Graphics |
---|
[2] | 13 | ; |
---|
[142] | 14 | ; @param POS |
---|
[231] | 15 | ; Vector composed by 4 elements giving coordinates of the left bottom |
---|
[142] | 16 | ; corner and of the right up one -in cm- in which we want to do the color bar |
---|
[2] | 17 | ; |
---|
[231] | 18 | ; @keyword _EXTRA |
---|
| 19 | ; Used to pass keywords |
---|
[2] | 20 | ; |
---|
[142] | 21 | ; @uses |
---|
[370] | 22 | ; <pro>common</pro> |
---|
[2] | 23 | ; |
---|
[142] | 24 | ; @restrictions |
---|
[163] | 25 | ; Only usable for Postscripts effectuated with plein2dessin |
---|
[2] | 26 | ; |
---|
[142] | 27 | ; @history |
---|
[157] | 28 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
[142] | 29 | ; 7/5/98 |
---|
[2] | 30 | ; |
---|
[142] | 31 | ; @version |
---|
| 32 | ; $Id$ |
---|
[2] | 33 | ; |
---|
[237] | 34 | ; @todo |
---|
| 35 | ; reference to plein2dessin in restriction not understable : |
---|
| 36 | ; plein2dessin does'nt exist. |
---|
| 37 | ; |
---|
[2] | 38 | ;- |
---|
[327] | 39 | PRO placecolor, pos, _EXTRA=ex |
---|
[114] | 40 | ; |
---|
| 41 | compile_opt idl2, strictarrsubs |
---|
| 42 | ; |
---|
[37] | 43 | @cm_4ps |
---|
| 44 | IF NOT keyword_set(key_forgetold) THEN BEGIN |
---|
| 45 | @updatenew |
---|
| 46 | ENDIF |
---|
| 47 | ; |
---|
[2] | 48 | xsave = !x |
---|
| 49 | ysave = !y |
---|
| 50 | psave = !p |
---|
[37] | 51 | ; |
---|
[2] | 52 | reinitplt, /z, /invert |
---|
| 53 | pos=1.*pos |
---|
[37] | 54 | mipgsz = min(page_size, max = mapgsz) |
---|
[2] | 55 | if key_portrait eq 1 then begin |
---|
[231] | 56 | pos[0]=pos[0]/mipgsz |
---|
| 57 | pos[1]=pos[1]/mapgsz |
---|
| 58 | pos[2]=pos[2]/mipgsz |
---|
| 59 | pos[3]=pos[3]/mapgsz |
---|
[2] | 60 | endif else begin |
---|
[231] | 61 | pos[0]=pos[0]/mapgsz |
---|
| 62 | pos[1]=pos[1]/mipgsz |
---|
| 63 | pos[2]=pos[2]/mapgsz |
---|
| 64 | pos[3]=pos[3]/mipgsz |
---|
[37] | 65 | ENDELSE |
---|
| 66 | ; |
---|
| 67 | def_myuniquetmpdir |
---|
| 68 | ; |
---|
| 69 | IF lmgr(/demo) EQ 1 THEN BEGIN |
---|
| 70 | ; if we are in demo mode, we cannot save the parameters in a temporary file... |
---|
| 71 | @cm_demomode_used |
---|
| 72 | ; |
---|
| 73 | colnumb = colorbarparam.colnumb |
---|
[231] | 74 | clbinf = colorbarparam.clbinf |
---|
[37] | 75 | clbsup = colorbarparam.clbsup |
---|
| 76 | clbdiv = colorbarparam.clbdiv |
---|
| 77 | ; |
---|
| 78 | ENDIF ELSE BEGIN |
---|
| 79 | file = myuniquetmpdir + '4colorbar.dat' |
---|
| 80 | IF file_test(file) THEN BEGIN |
---|
[231] | 81 | restore, file |
---|
| 82 | if size(ex, /type) EQ 8 then BEGIN |
---|
[37] | 83 | if (where(tag_names(ex) EQ 'MIN'))[0] NE -1 then clbinf = ex.MIN |
---|
| 84 | if (where(tag_names(ex) EQ 'MAX'))[0] NE -1 then clbsup = ex.MAX |
---|
| 85 | if (where(tag_names(ex) EQ 'DIVISIONS'))[0] NE -1 then clbdiv = ex.DIVISIONS |
---|
| 86 | ENDIF |
---|
| 87 | ; |
---|
| 88 | COLORBAR, COLOR = 0, DIVISIONS = clbdiv, DISCRET = colnumb $ |
---|
| 89 | , cb_color = 0, POSITION = pos, MAX = clbsup $ |
---|
| 90 | , MIN = clbinf, cb_charsize = !p.charsize $ |
---|
| 91 | , _extra = ex |
---|
| 92 | ENDIF |
---|
| 93 | ENDELSE |
---|
| 94 | ; |
---|
[2] | 95 | !x = xsave |
---|
| 96 | !y = ysave |
---|
| 97 | !p = psave |
---|
[231] | 98 | ; |
---|
[2] | 99 | return |
---|
| 100 | end |
---|