[ncl-talk] Issue with cnFillOpacityF in NCL 6.4.0

Rick Brownrigg brownrig at ucar.edu
Wed Jun 27 11:53:40 MDT 2018


Hi Tanya,

I am unable to duplicate this problem using a simple example script, as
seen in the attached snapshots. Can you either send an image of what you
are seeing, or send me the data so I can run your script locally?

Rick


On Wed, Jun 27, 2018 at 10:03 AM, Tanya Peevey <trpeevey at gmail.com> wrote:

> NCL Help,
>
> I found a strange behavior with the new cnFillOpacityF resource in NCL
> 6.4.0. This is a great resource, however, it does the below.
>
> The online information (https://www.ncl.ucar.edu/
> Applications/rgbacolor.shtml) says that cnFillOpacityF changes the
> opacity of all filled contours. When I use this resource by setting it to
> say, 0.8 for example, my polymarkers are also affected. This is unexpected
> since there is a separate resource for this, gsMarkerOpacityF. Am I missing
> something here? Am I setting my polymarker resource incorrectly. I'm going
> to work around this for now (by setting cnFillOpacityF back to 1.0 before
> adding the polymarkers), but here is a snippet of my code in case there
> is a solution to this that I'm missing.
>
> ************************************************************
> **********************************************
>
> wks3 = gsn_open_wks("pdf",OUT_DIR + PLOT3_FILE)
>
> gsn_define_colormap(wks3,"nrl_sirkes")
>
> gsn_reverse_colormap(wks3)
>
> cnlev3 = ispan(-40,40,4)  ; for m/s
>
>
> res1 = True
>
> res1 at gsnLeftString = " "
>
> res1 at gsnCenterString = DATE_START + ", FHR " + FHR(istep)
>
> res1 at gsnRightString = " "
>
> res1 at mpFillOn = True
>
> res1 at mpOutlineBoundarySets       = "National"
>
> res1 at mpOutlineBoundarySets       = "USStates"
>
> res1 at mpGeophysicalLineColor      = "gray35"
>
> res1 at mpGeophysicalLineThicknessF = 2
>
> res1 at mpLimitMode="LatLon"
>
> res1 at mpMinLatF = LAT_RANGE(0)
>
> res1 at mpMaxLatF = LAT_RANGE(1)                ;
>
> res1 at mpMinLonF = LON_RANGE(0)                ;
>
> res1 at mpMaxLonF = LON_RANGE(1)                ;
>
> res1 at mpCenterLonF= LON_RANGE(2)
>
> res1 at mpOutlineOn = True
>
> res1 at gsnDraw      = False
>
> res1 at gsnFrame     = False
>
> res1 at gsnMaximize  = True
>
> res1 at gsnPaperOrientation = "portrait"
>
> res1 at cnLevelSelectionMode = "ExplicitLevels"
>
> res1 at cnLineLabelsOn = False
>
> res1 at cnFillOn        = True
>
> res1 at cnLinesOn       = False
>
> res1 at gsnSpreadColors = True
>
> res1 at tiMainFontHeightF = 0.02
>
> res2 = True
>
> res2 at gsnLeftString = " "
>
> res2 at gsnRightString = " "
>
> res2 at gsnDraw         = False
>
> res2 at gsnFrame        = False
>
> res2 at cnLevelSelectionMode = "ExplicitLevels" ; use explicit levels
>
> res2 at cnLineLabelPlacementMode = "constant"
>
> res2 at cnFillOn        = False
>
> res2 at cnLineThicknessF = 1.5
>
> mres               = True                     ; marker mods desired
>
> mres at gsMarkerIndex = 1                       ; polymarker style
>
> mres at gsMarkerSizeF = 50.0                      ; polymarker size
>
> mres at gsMarkerColor = "black"                    ; polymarker color
>
> ;------------------------------------------------------------------
>
> ;  Plots: Vertical Velocity and Cloud Ice Water Content
>
> ;------------------------------------------------------------------
>
>
> res1 at cnLevels = cnlev3
>
> res1 at cnFillOpacityF = 0.8
>
> res1 at tiMainString = PLOT3_TITLE
>
> res2 at cnLevelSelectionMode = "AutomaticLevels"
>
>
> plot_filled = gsn_csm_contour_map(wks3,FLD7({P_LEVS(ilev)},:,:),res1)
>
> plot_lineNR = gsn_csm_contour(wks3,FLD5({P_LEVS(ilev)},:,:),res2)
>
>
> overlay(plot_filled,plot_lineNR)
>
>
> dum := new(2,graphic)
>
>
> dum(0) = gsn_add_polymarker(wks3,plot_filled,track_lon(0:istep),
> track_lat(0:istep),mres)
>
>
> mres at gsMarkerIndex = 3                       ; polymarker style
>
> mres at gsMarkerSizeF = 2.0                      ; polymarker size
>
> dum(1) = gsn_add_polymarker(wks3,plot_filled,lon_cloud,lat_cloud,mres)
>
>
> draw(plot_filled)
>
> frame(wks3)
>
> delete(wks3)
>
> delete([/res1 at cnLevels/])
>
>
> ************************************************************
> **********************************************
>
> Thank you,
> Tanya Peevey
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20180627/d6e4d3c9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snap1.png
Type: image/png
Size: 154397 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180627/d6e4d3c9/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snap2.png
Type: image/png
Size: 180265 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180627/d6e4d3c9/attachment-0003.png>


More information about the ncl-talk mailing list