Re: Help with NCL + WRF Main Title

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 25 2012 - 09:50:17 MDT

Hi Chris,

The WRF plotting scripts are set up to produce output that goes to an 8.5" x 11" paper. This means that titles are moved up, and footer subtitles are moved down in order to fill the whole page.

Further, the WRF scripts don't allow much control for moving the titles around.

What I recommend is copying

    $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl

to your own directory, and modifying this section of the code, which is the code I believe is drawing the title you're talking about:

 if (opts@TimePos .eq. "Left")
    MTOPosF = 0.30
  else
    MTOPosF = 0.20
  end if

 txt0 = create "MainPlotTitle" textItemClass wks
    "txString" : opts@MainTitle
    "txFontHeightF" : font_height*1.5
  end create
  anno = NhlAddAnnotation(cn,txt0)
  setvalues anno
    "amZone" : 3
    "amSide" : "Top"
    "amJust" : opts@MainTitlePos
    "amParallelPosF" : opts@MainTitlePosF
    "amOrthogonalPosF" : MTOPosF
    "amResizeNotify" : False
  end setvalues

Note the "amOrthogonalPosF" setting. This is what's moving the title up. You can try commenting this line out, or changing MTOPosF value to something larger than 0.0, but smaller than 0.2.

You can now load your own WRFUserARW.ncl instead of the system one:

  load "./WRFUserARW.ncl"

The "./" should be replaced with whatever the path is of your newly modified file.

If you need to do a lot more customization of your plots, then I might recommend using gsn_csm_xxxx scripts instead of wrf_xxxx scripts to do the plotting.

I recently added (I believe in V6.0.0) an undocumented function called "wrf_map_resources" that will set all the map resources necessary to do a nice WRF map,
that also allows you to use gsn_csm_contour_map to do the plotting.

See example #2 at:

http://www.ncl.ucar.edu/Applications/wrfpo.shtml

Although this script doesn't do it, it's okay to still user wrf_user_getvar to get variables off a WRF file.

--Mary

On Jun 23, 2012, at 3:32 PM, Chris Klich wrote:

> Hi, I am using mostly the built-in WRF functions to create my plots. I have the plots created nicely, however, I am having problems creating a "nice" looking title for the plot. I understand res@MainTitle seems to be the best way to do this, but it creates the title fairly far from the plot on top. Is there any way to move this title closer to the plot and/or change the font size? pltres@PlotTitle does not seem to work either when I use it.
>
> I attached the sample plot of what I mean when I show that the Main Title is very far away from the plot. It seems the "normal" NCL resources such as tiMainString, gsnCenterString etc. do not work when using WRF functions.
>
> I have e-mailed wrf-help, but they will be fairly unreachable for the next week and would like to solve this asap.
>
> Thank you,
> Chris
> <CO_D01_052208_12Z_LEVEL_0.png>_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 25 09:50:26 2012

This archive was generated by hypermail 2.1.8 : Mon Jun 25 2012 - 09:57:23 MDT