[ncl-talk] issue with resP at gsnMaximize in the Panel plots and 2nd label bar

Adam Phillips asphilli at ucar.edu
Wed Aug 26 11:21:52 MDT 2020


Load the following at the top of your script:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"      ; These four
libraries are automatically
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"       ; loaded from
NCL V6.4.0 onward.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"   ; No need for
user to explicitly load.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

The last library should give you access to drawNDCGrid.
v6.2.1 is 6 years old, if possible I recommend upgrading to the newest
version of NCL.
Adam


On Wed, Aug 26, 2020 at 11:14 AM Geeta Geeta <geetag54 at yahoo.com> wrote:

> fatal:syntax error: line 547 in file clim.div.wnd.w.v1.ncl before or near
> \n
> drawNDCGrid(wks)
> ----------------^
>
> fatal:syntax error: possibly an undefined procedure
> fatal:Syntax Error in block, block not executed
> fatal:error at line 568 in file clim.div.wnd.w.v1.ncl
>
> I have NCL version 6.2.1 so this error is coming.
>
> As suggested, I will switch off the resources and try
>
> thanks
>
> Geeta.
>
>
>
>
>
>
>
>
>  On Wednesday, 26 August, 2020, 10:37:23 pm IST, Adam Phillips <
> asphilli at ucar.edu> wrote:
>
>
>
>
>
>  Hi Geeta,One last item to change would be to set resQ at lbLabelBarOn =
> False. If after making all of those changes, you do not see an improvement,
> I recommend you alter the end of your script to look like this: resP
>   =  True
> resP at gsnFrame = False
> resP at gsnMaximize        = True                ; maximize plots
> resP at gsnPanelLabelBar   =  True
> resP at lbOrientation   =  "Vertical"
> gsn_panel(wks,PLOT,(/4,1/),resP)
> drawNDCGrid(wks)frame(wks)
> If the resulting image extends most of the way to the boundaries of the
> gray grid, then your image is maximized in NCL's workspace.
> If the resulting image does not extend all the way to the edges, I
> strongly suggest you clean up your resource lists, and start turning off
> resources (and removing overlays) one by one to see if you can see what is
> causing the plots to not fill the space. That is how I debug plotting
> issues that are not apparent. I would start with not doing any overlays and
> see if the paneled plots are the same sizes. Hope that helps!Adam
> On Wed, Aug 26, 2020 at 10:52 AM Geeta Geeta <geetag54 at yahoo.com> wrote:
> thanks Mr Brownrigg.
>
> Sorry for the typo. I did not notice it. The warning message has gone but
> plot size is the same.
>
>
>
> Geeta.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  On Wednesday, 26 August, 2020, 06:46:29 pm IST, Rick Brownrigg <
> brownrig at ucar.edu> wrote:
>
>
>
>
>
>
>
>
>
>
>
>  Hi,
>
> The resource errors are due to a typo -- it should be tiMainOn.
>
> I'm not sure about the sizing.
>
> Rick
>
>
>
>
>
>
>
> On Wed, Aug 26, 2020 at 3:47 AM Geeta Geeta via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
> Thanks Mr Phillips.
>
>
>
> I did as you had told me to.
>
>
>
> 1. commented the draw and frame lines and added those Resources to the
> panel plots.  and  rescommon at tiMain            = False
>
>
>
>
>
>
>
> but got warning message. warning:tiMain is not a valid resource in
> wind_contour at this time
>
>
>
> warning:tiMain is not a valid resource in map at this time
>
>
>
> warning:tiMain is not a valid resource in wind_vector at this time
>
>
>
> warning:tiMain is not a valid resource in wind_vector at this time
>
>
>
> warning:tiMain is not a valid resource in wind_vector at this time
>
>
>
> warning:tiMain is not a valid resource in wind_contour at this time
>
>
>
> warning:tiMain is not a valid resource in wind_contour at this time
>
>
>
> warning:tiMain is not a valid resource in wind_contour at this time
>
>
>
> warning:tiMain is not a valid resource in wind_contour at this time
>
>
>
> warning:tiMain is not a valid resource in map at this time
>
>
>
>
>
>
>
>
>
>
>
> 2. No of Plots are now =4.
>
>
>
>
>
>
>
> But the size of plot remains the same. These are overlay plots which I am
> panelling.
>
>
>
>  PLOT            =     new(4,graphic)
>
>
>
>                              gsn_panel(wks,PLOT,(/4,1/),resP)
>
>
>
>
>
>
>
>
>
>
>
> thanks once again. I am attaching the figure so obtained.
>
>
>
>
>
>
>
> Geeta.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  On Tuesday, 25 August, 2020, 09:13:40 pm IST, Adam Phillips <
> asphilli at ucar.edu> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  Hi Geeta,It looks like you are drawing each individual plot and then
> advancing the frame before your call gsn_panel:draw(PLOT(3))
>
>
>
> frame(wks)
>
>
>
>
>
>
>
> remove all of the draw(PLOT  lines and the frame(wks) lines. I am
> surprised you are not getting an error message when you are doing this as
> you are trying to draw the same plot twice.
>
>
>
> Assuming you corrected the definition of PLOT to be of size 4, there are a
> few other steps you can take to try to minimize the space between the
> panels (and therefore increase the size of each panel).Try setting these:
>
>
>
> rescommon at tiMainOn = False   ; turn off main title; do not save space for
> main titleresP at gsnPanelYWhiteSpacePercent = 0.0   ; set the amount of
> Y-axis space between the panels equal to 0.
>
>
>
> Hope that helps!Adam
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Mon, Aug 24, 2020 at 10:32 PM Geeta Geeta <geetag54 at yahoo.com> wrote:
>
>
>
> Thank you Mr Phillips.
>
>
>
>
>
>
>
> I will try with label bar resources.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I also wanted know why the plots are so small. when I have set
> resP at gsnMaximize        = True                ; maximize plots in the
> panel plot resources.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> what I should do to make them cover the entire page.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Geeta.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  On Monday, 24 August, 2020, 09:57:49 pm IST, Adam Phillips <
> asphilli at ucar.edu> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  Hi Geeta,1 - You are getting the error message because PLOT was defined
> like this:PLOT            =     new(5,graphic)
>
>
>
>
>
>
>
> but then  4 plots were specified in your call to
> gsn_panel:gsn_panel(wks,PLOT,(/4,1/),resP)
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Set PLOT = new(4,graphic) and the error will disappear.
>
>
>
>
>
>
>
> 2 - If you set cnFillOn = False, NCL will not draw a labelbar even if you
> set lbLabelBarOn = True. You will need to use gsn_labelbar_ndc or
> gsn_create_labelbar. I prefer gsn_labelbar_ndc unless you need to attach a
> labelbar to a plot. See the examples at the bottom of the gsn_labelbar_ndc
> documentation page, specifically the first example, for how to use this
> procedure.
>
>
>
>
>
>
>
> 3 - There are numerous ways to alter the labelbar, most of which are shown
> in the labelbar applications page here:
> http://www.ncl.ucar.edu/Applications/labelbar.shtml
>
>
>
>
>
>
>
> Hope that helps!Adam
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Mon, Aug 24, 2020 at 5:39 AM Geeta Geeta via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>
>
>
>
>
>
> Hi
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I am making panel plots with 4 rows and 1 column.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I have set following resources in the PANEL plots
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>       resP        =  True
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>       resP at gsnMaximize        = True                ; maximize plots
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>       resP at gsnPanelLabelBar  =  True
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>       resP at lbOrientation  =  "Vertical"
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> So 1st problem is panel plots are very small. this is the error coming.  I have defined 4 rows and 1 columns and the no pf PLOTS=4
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> then why this warning message is coming
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> (0) Warning: gsn_panel: you have more plots than you have panels.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> (0) Only 4 plots will be drawn.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  2.  The second label bar wrt the Q contour is not shown.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 3. How can I adjust the two label bars. (one for filled contours and other for the line)
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> kindly suggest.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Geeta._______________________________________________
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ncl-talk mailing list
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ncl-talk at mailman.ucar.edu
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> List instructions, subscriber options, unsubscribe:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
>
>
>
>
>
>
>
> Adam Phillips
>
>
>
>
>
>
>
> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
>
>
>
>
>
>
>
> www.cgd.ucar.edu/staff/asphilli/   303-497-1726
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
>
>
>
> Adam Phillips
>
>
>
> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
>
>
>
> www.cgd.ucar.edu/staff/asphilli/
> 303-497-1726_______________________________________________
>
>
>
> ncl-talk mailing list
>
>
>
> ncl-talk at mailman.ucar.edu
>
>
>
> List instructions, subscriber options, unsubscribe:
>
>
>
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> --
> Adam Phillips
> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
> www.cgd.ucar.edu/staff/asphilli/   303-497-1726
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200826/2fa4f969/attachment.html>


More information about the ncl-talk mailing list