Hello,
I am trying to use the new IDL graphics, but am struggling with a couple aspects. I have two questions:
1. How can you overplot a single contour that has a value of ZERO? If I set c_value=0, that tells CONTOUR to use N_LEVELS. I can generate the filled contour plot just fine, but I like to overplot the zero line.
2. How can you change the number of major ticknames for the COLORBAR function? I would like to compose a figure that has e.q. 21 filled contours, but a discrete color bar that has a tick interval of e.g. 4. I have tried applying many of the properties, but none work!
Here is an example:
;TESTING***
; Make Discrete Color Levels
ct_number = 39
nlevels=21
fdata=findgen(256,80)/(256*80)-0.5
levels=(findgen(nlevels)-(nlevels-1)/2.)*max(fdata)/(nlevels-1)*2.
ct_indices = BYTSCL(levels)
LOADCT, ct_number, RGB_TABLE=ct, /SILENT
step_ct = CONGRID(ct[ct_indices, *], 256, 3)
c1 = CONTOUR(fdata, $
indgen(256),indgen(80), $
c_value = levels, $
RGB_TABLE = step_ct, $
RGB_INDICES = ct_indices, $
/FILL, /buffer, xstyle=1,ystyle=1, $
MARGIN = [0.15, 0.20, 0.15, 0.15], $
TITLE = 'TESTING')
c2 = CONTOUR(fdata, $
indgen(256),indgen(80), $
c_value = 0, c_color=0, n_levels=1, c_label_show=0,$
xstyle=1,ystyle=1,overplot=1)
cb = COLORBAR( $
TARGET = c1, $
TICKLEN = 0, $
MAJOR = 5, $
FONT_SIZE = 10, $
BORDER=1, $
POSITION = [0.2, 0.07, 0.8, 0.1])
c1.save, 'testing.png'
Any help would be much appreciated!
Thank you,
Rob
|