> cgLoadCT, 22, /Brewer
> tvlct, 0, 0, 0, 0
> tvlct, 255, 255, 255, 255
>
> cgColorbar, /Brewer, CTindex=22, TCharsize=0.12, $
> range=[minval,maxval],/right, tlocation='right', $
> Title='d',/Vertical, Font=-1, Minor=5, $
> Position=[0.81,0.32,0.83,0.90]
Firstly, you need to add NCOLORS = 6 to both cgLoadCT and cgColorbar, Secondly, don't use the BREWER and CTINDEX keywords when you call cgColorbar; you have already loaded the color table you want. See the difference between
cgLoadCT, 22, /brewer, nColors = 6
cgColorbar, nColors = 6
and
cgLoadCT, 22, /brewer, nColors = 6
cgColorbar, /brewer, ctIndex = 22, nColors = 6
The last one does not use the color table you have loaded with cgLoadCT. Also note that when you do
tvlct, 0, 0, 0, 0
you are overwriting the first element of the color table. Therefore, black becomes one of the six colors you are using. If this is not the desired behavior, then perhaps you should place this outside the first six elements. I suggest using cIndex to look at what this does to your color table.
|