[ncl-talk] masking beneath an xy-plot (Karin Meier-Fleischer)

Karin Meier-Fleischer meier-fleischer at dkrz.de
Sat Jan 27 08:23:40 MST 2018


Hi Dave,

I have no problems using your script after inserting the two lines. See 
attached script and plot.

-Karin

Am 27.01.18 um 11:28 schrieb dave montgomery via ncl-talk:
>
>
> Dear Karin,
> Thanks for your suggestion. However, it didn't provide the solution I 
> am seeking. It gave the following:
> warning:gsnBelowYRefLineColor is not a valid resource in mainplot_xy 
> at this time
> warning:gsnRefLine is not a valid resource in mainplot_xy at this time
> I would appreciate any help.
> Best regards
> D. Montgomery
>
>
>
> On Friday, 26 January 2018, 20:06, Ehimen Williams 
> <montgomery_dave at yahoo.com> wrote:
>
>
> Dear Mary,
> Thanks again for your quick response.
> Best regards
> D. Montgomery.
> Dear Mary,
> Thanks again for your quick response.
> Best regards
> D. Montgomery.
>
>
> On 26 Jan 2018 20:00, ncl-talk-request at ucar.edu 
> <mailto:ncl-talk-request at ucar.edu> wrote:
> >
> > Send ncl-talk mailing list submissions to
> > ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> > or, via email, send a message with subject or body 'help' to
> > ncl-talk-request at ucar.edu <mailto:ncl-talk-request at ucar.edu>
> >
> > You can reach the person managing the list at
> > ncl-talk-owner at ucar.edu <mailto:ncl-talk-owner at ucar.edu>
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of ncl-talk digest..."
> >
> >
> > Today's Topics:
> >
> >    1. Re: masking beneath an xy-plot (Karin Meier-Fleischer)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Fri, 26 Jan 2018 17:41:51 +0100
> > From: Karin Meier-Fleischer <meier-fleischer at dkrz.de 
> <mailto:meier-fleischer at dkrz.de>>
> > To: ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
> > Subject: Re: [ncl-talk] masking beneath an xy-plot
> > Message-ID: <3b395474-a4d4-cc75-8785-fc02028fdc28 at dkrz.de 
> <mailto:3b395474-a4d4-cc75-8785-fc02028fdc28 at dkrz.de>>
> > Content-Type: text/plain; charset="utf-8"; Format="flowed"
> >
> > Hi Dave,
> >
> > try
> >
> > ?mres at gsnBelowYRefLineColor <mailto:mres at gsnBelowYRefLineColor> = (/ 
> "black", "black"/)
> > ?mres at gsnYRefLine <mailto:mres at gsnYRefLine>?????????? = (/ 100, 1000 /)
> >
> > -Karin
> >
> > Am 26.01.18 um 17:08 schrieb dave montgomery via ncl-talk:
> > > Dear NCL Users,
> > > I did an overlay of an xy plot on a few plots. The problem is I can't
> > > find an example or a function that I could use in masking out areas
> > > just beneath the xy plot (the green line is the xy plot). I am
> > > counting on your invaluable insight and help in solving this problem.
> > > I have attached the plot and associated files herewith. I am using 
> NCL
> > > Version 6.3.
> > > Many thanks.
> > > D. Montgomery
> > >
> > >
> > > _______________________________________________
> > > ncl-talk mailing list
> > > ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
> > > List instructions, subscriber options, unsubscribe:
> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> > --
> > Dipl. Geophys. Karin Meier-Fleischer
> > Visualization, NCL, CDO
> > Application Support
> >
> > Deutsches Klimarechenzentrum GmbH (DKRZ)
> > Bundesstrasse 45a - D20146 Hamburg - Germany
> >
> > Phone:    +49 (0)40 460094 126
> > Fax:      +49 (0)40 460094 270
> > E-Mail: meier-fleischer at dkrz.de <mailto:meier-fleischer at dkrz.de>
> > URL:      www.dkrz.de
> >
> > Gesch?ftsf?hrer: Prof. Dr. Thomas Ludwig
> > Sitz der Gesellschaft: Hamburg
> > Amtsgericht Hamburg HRB 39784
> >
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: 
> <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180126/dda872f0/attachment-0001.html>
> >
> > ------------------------------
> >
> > Subject: Digest Footer
> >
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
> > ------------------------------
> >
> > End of ncl-talk Digest, Vol 170, Issue 55
> > *****************************************
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
Dipl. Geophys. Karin Meier-Fleischer
Visualization, NCL, CDO
Application Support

Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany

Phone:    +49 (0)40 460094 126
Fax:      +49 (0)40 460094 270
E-Mail:   meier-fleischer at dkrz.de
URL:      www.dkrz.de

Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180127/165ed3f7/attachment.html>
-------------- next part --------------
;--------------------------------------------------------
begin
 a  = addfile("mainprf.nc","r")
 t  = a->air
 w  = a->omega
 u  = a->uwnd(0,:,:,{96})
 g  = a->hgt
 v  = a->vwnd
;-------------
 g1 = 1013*(1-6.5/288000*g)^5.255
 g1 at units  = "hPa"
 copy_VarCoords(g,g1)
 ;printVarSummary(g1)
 ;print(g1)
 v  = 0.
;------------
 ;umin = (u)
 ;umax = (u)
;-----------------------------------------
 wks  = gsn_open_wks ("png", "mainplot" )          ; send graphics to PNG file

 res   = True                                     ; plot mods desired
 
 res at cnFillOpacityF = 0.4
 res at tiMainString    = "NCEP/NCAR Reanalysis Data June-September 2016 @ 96E" ; title

 res at gsnDraw              = False                ; do not draw the plot
 res at gsnFrame             = False                ; do not advance the frame
 res at cnLevelSelectionMode = "ManualLevels"       ; manually select levels
 res at cnLevelSpacingF      = 10.0                  ; contour spacing
 res at cnMinLevelValF       = 300.                 ; min level
 res at cnMaxLevelValF       = 390.                 ; max level
 res at cnLineLabelsOn       = False                 ; turn on line labels
 res at cnFillOn             = True                 ; turn on color fill
 res at cnFillPalette        = "MPL_rainbow"             ; choose colormap

 res at tiYAxisString     = "Pressure Levels (hPa)"
 res at gsnLeftString     = "Mean Potential Air Temperature"
 res at gsnRightString    = t at units

 res at vcRefMagnitudeF = 5.0                ; define vector ref mag
 res at vcRefLengthF    = 0.08              ; define length of vec ref
 res at vcGlyphStyle    = "CurlyVector"      ; turn on curly vectors
 res at vcMinDistanceF  = 0.04               ; thin out vectors
 res at vcMapDirection  = True

 res at vcLineArrowColor        = "Blue"       ; change vector color
 res at vcLineArrowThicknessF   = 2.0          ; change vector thickness
 res at vcRefAnnoArrowLineColor = "black"      ; change ref vector color
 res at vcRefAnnoArrowUseVecColor = False      ; don't use vec color for ref

 plot1  = gsn_csm_pres_hgt_vector(wks, t(0,:,:,{96}),v(0,:,:,{96}),w(0,:,:,{96}), res )
;------------------------------------------------
 sres   = True                                 ; plot mods desired
 
 sres at cnLineLabelsOn       = True              ; turn on line labels
 sres at cnLineColor          = "Red"             ; color of contour
 sres at cnInfoLabelOn        = False             ; turn off info label
 sres at gsnDraw              = False             ; do not draw the plot
 sres at gsnFrame             = False             ; do not advance the frame

 sres at gsnLeftString     = " "
 sres at gsnRightString    = " "

 plot2  = gsn_csm_pres_hgt(wks, u, sres )
;-----------------------
 mres   = True
 mres at gsnLeftString     = " "
 mres at gsnRightString    = " "
 mres at gsnDraw           = False                      ; do not draw the plot
 mres at gsnFrame          = False                      ; do not advance the frame
 mres at xyLineThicknesses = (/3.0/)                    ; make line thicker
 mres at xyLineColors      = (/"green"/)                ; change line color

 mres at gsnBelowYRefLineColor = (/ "black", "black"/)
 mres at gsnYRefLine           = (/ 100, 1000 /)


 plot3  = gsn_csm_xy(wks,g1&lat,g1(0,:,{96}),mres)     ; create plot
;-----------------------------
 overlay(plot1,plot2)
 overlay(plot1,plot3)
 draw(plot1)
 frame(wks)
end
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mainplot.png
Type: image/png
Size: 159143 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180127/165ed3f7/attachment.png>


More information about the ncl-talk mailing list