[ncl-talk] attach column of plots

Adam Phillips asphilli at ucar.edu
Wed Jun 22 14:14:32 MDT 2016


Hi Noelia,
You cannot attach them as a group. I think you want to attach plotJ(0) and
plotM(0) together, then move on to attach the 1st plots together, and so
on. Try this:
attach_id1 = gsn_attach_plots(plotD(0),plotM(0),True,True)
attach_id2 = gsn_attach_plots(plotD(1),plotM(1),True,True)
and so on..
Hope that helps!
Adam

On Wed, Jun 22, 2016 at 9:09 AM, Noelia otero <noeli1680 at gmail.com> wrote:

> Hi Guido,
>
> Yes, I have different plot per seasons..the thing is that each plot is a
> panel plot, I mean plotD contains 10 plot, and so on..since I have 10
> models. Then, I wanted to plot all seasons for all plots..that's why I
> wanted to do that..maybe there is another simpler way..?
>
> Thanks!
>
> 2016-06-22 15:51 GMT+02:00 Guido Cioni <guidocioni at gmail.com>:
>
>> Hi Noelia,
>>  I assume that your plots are referred to different season, so why do you
>> want to attach them? If your primary goal is to panel your 4 plots in a 2x2
>> matrix then I would suggest to use the gsn_panel  functionality instead.
>> You can easily achieve that by doing something like
>>
>> gsn_panel(wks,(/plotD,plotM,plotJ,plotS/),(/2,2/),True)
>>
>> Maybe I misunderstood the question, let me know.
>> cheers
>>
>>
>> Guido Cioni
>> http://guidocioni.altervista.org
>>
>> On 22 Jun 2016, at 13:51, Noelia otero <noeli1680 at gmail.com> wrote:
>>
>> 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
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://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

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160622/68925f71/attachment.html 


More information about the ncl-talk mailing list