[ncl-talk] Overlay Plots

Mary Haley haley at ucar.edu
Wed Dec 16 11:01:20 MST 2015


Geeta,

You want to use gsn_panel if you want to put 10 plots on one page.

We have numerous panel examples.

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

You will need to use a "do" loop to loop across the 10 files, and create
the plot of the 3 variables inside the do loop.  Use a "graphic" array to
hold the 10 plots, so you can panel them later.

The code may look something like this:

files = systemfunc("ls fnl*grib2")    ; get the list of 10 files. you can
also just list them individually
nfiles = dimsizes(files)      ; nfiles=10

. . .
. . .set graphical resources desired. . .

plots = new(nfiles,graphic)
do n=0,nfiles-1
  f = addfile(files(n),"r")
; Extracting data at 850  & 300 hpa
  t               = f->TMP_P0_L100_GLL0(20,:,:)
  u               = f->UGRD_P0_L100_GLL0(20,:,:)
  v               = f->VGRD_P0_L100_GLL0(20,:,:)
  hgt             = f->HGT_P0_L100_GLL0(9,:,:)
  plots(n)  = gsn_csm_vector_scalar(wks,u,v,t,res_vc)
end do

  pres = True
  gsn_panel(wks,plots,(/2,5/),pres)

Please see the panel examples page for different ways to set titles inside
the do loop, etc.

--Mary

On Sun, Dec 13, 2015 at 4:08 AM, Geeta Geeta <geetag54 at yahoo.com> wrote:

>
> I am attaching my image file. I wanted to plot the 10 plots in one frame
> for 3 varaibles. the 3 vriables are from the same file. So I will have 10
> different files.
>
>
>
> Geeta.
>
> _______________________________________________
> 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/20151216/ec6519db/attachment.html 


More information about the ncl-talk mailing list