Thanks Peter,
This has helped alot. You were right in assuming that 'some other
variable' is defined and to be plotted over both land and sea, but does
not fill the entire region. And further I had hoped to overlay several
(non-overlapping) filled variables in the plot. Creating the colour
table and appropriately filling a 'plot_array' works well. I will
certainly use this in the future.
Unfortunately, I want to make use of the map projections and continents
within the mapping routines as well!
The solution I've come up with is to use tvrd to capture each screen I
want, then merge them together, in a similar fashion as you suggested
above.
It's a bit clunky, but this is the script I came up with:
map_set,cen_lat,cen_lon, $
limit = [min(xlat), min(xlong), max(xlat), max(xlong)], $
/lambert, /continents
;get terrain image
contour,hgt,xlong,xlat,levels = [0,1,100,500,750,1000,1500,2000,2500],
$
c_colors = [0,2,4,6,8,10,12,14,15],/fill, /overplot
array_1 = tvrd(true=1)
;get variable points to overlay, in this case xland
plot_points = where(xland ge 2, count)
sxld= size(xland)
plot_array = intarr(sxld[1],sxld[2])
if count ne 0 then plot_array[plot_points] = 1
contour, plot_array, xlong, xlat, levels = [1], $
c_colors = [0], /fill, /overplot ; plot ocean white
array_points = tvrd()
points = where(array_points ne 0, count)
; get variable image
contour, xland, xlong, xlat, levels = [2], $
c_colors = [64], /fill, /overplot
array_2 = tvrd(true=1)
; overlay array_2 onto array_1 at overlay points
if count ne 0 then begin
array_temp = reform(array_1[0,*,*])
array_temp[points] = (array_2[0,*,*])[points]
array_1[0,*,*] = array_temp
array_temp = reform(array_1[1,*,*])
array_temp[points] = (array_2[1,*,*])[points]
array_1[1,*,*] = array_temp
array_temp = reform(array_1[2,*,*])
array_temp[points] = (array_2[2,*,*])[points]
array_1[2,*,*] = array_temp
endif
tv, array_1, true = 1
It seems to do okay!
Cheers, Sarah
|