[ncl-talk] plotting RGBA in pdf problem
sk
sdk0084 at yahoo.com
Tue Sep 9 04:30:58 MDT 2014
Hi,
I have problem to output my figure correctly in pdf (only red layer is visible, see below) but everything is fine if i output on screen or in png format.
the following pieces of the code shows how i create the plot
;---Construct RGBA colormaps...
ramp = fspan(0., 1., 255)
reds = new((/255, 4/), float)
greens = new((/255, 4/), float)
blues = new((/255, 4/), float)
reds = 0
greens = 0
blues = 0
reds(:,0) = ramp
greens(:,1) = ramp
blues(:,2) = ramp
reds(:,3) = 1.
greens(:,3) = 0.
blues(:,3) = 0.
wks = gsn_open_wks("pdf","../figures/"+prefix)
......
sres at lbLabelBarOn = False
sres at cnFillMode = "RasterFill"
sres at cnLevelSelectionMode = "EqualSpacedLevels"
sres at cnMaxLevelCount = 254
sres at cnFillBackgroundColor = (/ 1., 1., 1., 1./)
sres at cnFillColors = greens
greenMap = gsn_csm_contour(wks, g, sres)
sres at cnFillColors = blues
blueMap = gsn_csm_contour(wks, b, sres)
sres at cnFillColors = reds
plots(ri,0) = gsn_csm_contour_map(wks, r, sres)
overlay(plots(ri,0), greenMap)
overlay(plots(ri,0), blueMap)
draw(plots(ri,0))
........
gsn_merge_colormaps(wks,"MPL_gist_yarg","precip3_16lev")
dres = res ;up to here: resources for filled contours without thickmarks
.....
plots(ri,1) = gsn_csm_contour_map(wks,pcp,dres)
plot_w1 = gsn_csm_vector(wks,u,v,vres)
plot_p = gsn_csm_contour(wks,emi,eres)
overlay(plots(ri,1), plot_w1)
overlay(plots(ri,1), plot_p)
draw(plots(ri,1))
....
Is it ncl limitation or i have to do something more?
Regards,
sk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140909/6f85f23b/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fig1.pdf
Type: application/pdf
Size: 799550 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140909/6f85f23b/attachment-0001.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fig1.png
Type: image/png
Size: 431516 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140909/6f85f23b/attachment-0001.png
More information about the ncl-talk
mailing list