- Timestamp:
- 09/14/07 15:19:43 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltv.pro
r263 r286 19 19 ; @param MAX {in}{optional}{default=max of DATA (on non-masked points)} 20 20 ; 21 ; @keyword BOTTOM {default= 0}22 ; The lowest color index of the colors to be used 21 ; @keyword BOTTOM {default=1} 22 ; The lowest color index of the colors to be used. 23 23 ; 24 24 ; @keyword BOXZOOM … … 40 40 ; The color number that should be used for the mask values. 41 41 ; 42 ; @keyword INV 43 ; Reverse the color order 44 ; 42 45 ; @keyword MASKVAL {default=1.e+20} 43 46 ; The mask value. Note that if abs(mask) < 1.e6, then the … … 71 74 ; 72 75 PRO pltv, data, min, max, BOTTOM = bottom, BOXZOOM = boxzoom $ 73 , C_MASK = c_mask, C_NAN = c_nan, MININ = minin, MAXIN = maxin $76 , C_MASK = c_mask, C_NAN = c_nan, INV = inv, MININ = minin, MAXIN = maxin $ 74 77 , MASKVAL = maskval, NCOLORS = ncolors, NOINTERP = nointerp $ 75 78 , _EXTRA = ex … … 103 106 ;------------------------------------------------------------ 104 107 ncolmax = !d.n_colors < 256 105 IF n_elements(bottom) EQ 0 THEN bottom = 1 106 IF NOT keyword_set(ncolors) then ncolors = ncolmax - 1 - bottom107 topcol = (bottom + ncolors - 1) < (ncolmax - 1)108 IF n_elements(bottom) EQ 0 THEN bottom = 1 ELSE bottom = 0 > bottom 109 IF NOT keyword_set(ncolors) then topcol = ncolmax - 2 ELSE topcol = (bottom + ncolors - 1) < (ncolmax - 1) 110 ncolors = topcol - bottom + 1 108 111 ;------------------------------------------------------------ 109 112 ; Do we have NaN values in z2d??? … … 153 156 z2d[maskind] = cmask 154 157 ENDIF 158 ; reverse colors (from topcol to bottom instead of bottom to topcol) 159 IF keyword_set(inv) THEN BEGIN 160 m = float(topcol - bottom )/float(bottom - topcol) 161 p = float(bottom^2 - topcol^2)/float(bottom - topcol) 162 z2d = m * temporary(z2d) + p 163 ENDIF 164 ; avoid rounding errors 155 165 z2d = round(temporary(z2d)) 156 166 ; use byte type to save memory … … 184 194 , INTERVALLE = float(max-min)/(topcol-bottom) $ 185 195 , _extra = ex 186 plot, [0], [0], /noerase, /nodata, xstyle = 1, ystyle = 1 196 plot, [0], [0], /noerase, /nodata, xstyle = 1, ystyle = 1, _extra = ex 187 197 188 198 IF keyword_set(masked) THEN tracemask, msk, indgen(dtasize[0]), indgen(dtasize[1]) … … 190 200 ; color bar 191 201 ;------------------------------------------------------------ 192 barrecouleur, 0, min, max, 10, bottom = bottom, position = posbar, ncolors = (topcol-bottom+1), _extra = ex 202 IF keyword_set(inv) THEN colors = topcol - bindgen(ncolors) ELSE colors = bottom + bindgen(ncolors) 203 barrecouleur, colors, min, max, 10, position = posbar, _extra = ex 193 204 ; 4) End of drawing 194 205 terminedessin, _extra=ex
Note: See TracChangeset
for help on using the changeset viewer.