[ncl-talk] attach column of plots

Noelia otero noeli1680 at gmail.com
Wed Jun 22 05:51:05 MDT 2016


Hi all,

I would like to ask for some help to create a plot attaching 4 column of
plots. I saw the example panel_10.ncl , but it is not clear to me how to do
it.


First I am plotting 4 different column of plots:

  plotD=new(10, graphic)
  plotM=new(10, graphic)
  plotJ=new(10, graphic)
  plotS=new(10, graphic)


  res                      = True
  res at gsnMaximize          = False        ; Maximize in frame
  res at gsnDraw              = False        ; Don't draw plots
  res at gsnFrame             = False        ; Don't advance frame
  res at cnFillOn             = True         ; Turn on contour fill
  res at cnInfoLabelOn        = False        ; Turn off info label
  res at cnLineLabelsOn       = False        ; Turn off line labels
  res at cnLinesOn            = False        ; Turn off contour lines
  res at cnLevelSelectionMode = "ExplicitLevels"
  res at lbLabelBarOn         = False
  res at gsnAddCyclic         = False

  res at mpMinLatF            = min(lat)
  res at mpMaxLatF            = max(lat)
  res at mpMinLonF            = min(lon)
  res at mpMaxLonF            = max(lon)


  :get the values
  do i = 0,nplots-1    ;nplots =10

      cwtM = systemfunc("ls " + dirM2(i) + "freq*nc")
      do k = 0,3     ;loop seasons

        fileM = addfile(cwtM(k), "r")
        names = getfilevarnames(fileM)
        model = fileM->$names(j+3)$(0,:,:)
        ;print(names(j))
        ;print(max(model))

       if(k.eq.0) then ; plotting seasons
        plotD(i)= gsn_csm_contour_map(wks,model,res)
         else if(k.eq.1) then
        plotJ(i)= gsn_csm_contour_map(wks,model,res)
         else if(k.eq.2) then
        plotM(i)= gsn_csm_contour_map(wks,model,res)
         else if(k.eq.3) then
        plotS(i)= gsn_csm_contour_map(wks,model,res)
         end if
        end if
       end if
      end if


      end do
     end do

My idea now would be attach all of them to get the 4 columns together. I
tried to attach (first, with 2), but it is not working:

 attach_id1 = gsn_attach_plots(plotD,plotM,True,True)

I am not sure if attaching the plots would work here..or if there would be
another way to combine different columns of plots.
I'd really appreciate any suggestion ,

many thanks

Noelia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160622/3ae9a7cc/attachment.html 


More information about the ncl-talk mailing list