[ncl-talk] plotting RGBA in pdf problem
sk
sdk0084 at yahoo.com
Wed Sep 10 06:29:56 MDT 2014
agree,
I hope the ncl-guys here in the forum will make this limitation to be overcome in next release.
Regards,
SK
On Tuesday, September 9, 2014 7:43 PM, Rick Brownrigg <brownrig at ucar.edu> wrote:
Hi,
Unfortunately, this is a known problem -- this color-compositing technique only works for the image-based output formats, not the document-based formats (ps, pdf, eps). I thought this was documented, but the only place I see it mentioned is in the code for example #9 at:
http://ncl.ucar.edu/Applications/rgbacolor.shtml
This limitation should be noted a bit more prominently.
Rick
On Tue, Sep 9, 2014 at 4:30 AM, sk <sdk0084 at yahoo.com> wrote:
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
>
>
>
>
>
>
>
>
>
>
>_______________________________________________
>ncl-talk mailing list
>List instructions, subscriber options, unsubscribe:
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140910/55ab9aed/attachment.html
More information about the ncl-talk
mailing list