[ncl-talk] Paneling overlaid plots

Tabish Ansari tabishumaransari at gmail.com
Fri Feb 8 09:46:13 MST 2019


Hi,

I have three plots which I want to panel in 3 rows and 1 column.
However, actually each of these 3 plots are a combination of 23 plots
overlaid on top of each other.

It seems that they cannot be panelled assuming they're single plots.

Here's the code snippet:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
plot1 = new(23,graphic)
plot2 = new(23,graphic)
plot3 = new(23,graphic)

tt = fspan(.5,0.9,23)    ; variable spacings between each legend on the
lines which increase for every next line
do gg = 0,19
    res at xyLineDashSegLenF = tt(gg)
    res at xyExplicitLabels = s(gg)
    res at xyLineColors = s1(0)
    plot1(gg) = gsn_csm_xy(wks,timearr,pm25_Beijing_combmatrix(gg,:),res)
    plot2(gg) = gsn_csm_xy(wks,timearr,pm25_APEC2_combmatrix(gg,:),res)
    plot3(gg) = gsn_csm_xy(wks,timearr,pm25_APEC3_combmatrix(gg,:),res)
    if (gg.ge.1) then
       overlay(plot1(0),plot1(gg))
       overlay(plot2(0),plot2(gg))
       overlay(plot3(0),plot3(gg))
    end if
end do

do gg = 20,22
    res at xyLineDashSegLenF = tt(gg)
    res at xyExplicitLabels = s(gg)
    res at xyLineColors = s1(gg-19)
    plot1(gg) = gsn_csm_xy(wks,timearr,pm25_Beijing_combmatrix(gg,:),res)
    plot2(gg) = gsn_csm_xy(wks,timearr,pm25_APEC2_combmatrix(gg,:),res)
    plot3(gg) = gsn_csm_xy(wks,timearr,pm25_APEC3_combmatrix(gg,:),res)
    if (gg.ge.1) then
       overlay(plot1(0),plot1(gg))
       overlay(plot2(0),plot2(gg))
       overlay(plot3(0),plot3(gg))
    end if
end do

;************************************************
; create panel
;************************************************
  resP                    = True                 ; modify the panel plot
  resP at gsnPanelYWhiteSpacePercent = 0.0
  resP at gsnPanelXWhiteSpacePercent = 0.0
  gsn_panel(wks,(/plot1,plot2,plot3/),(/3,1/),resP)               ; now
draw as one plot
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


with this set up I'm getting the following error:
fatal:Number of dimensions in parameter (1) of (gsn_panel) is (2), (1)
dimensions were expected
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 391 in
file plot-pulseruns-envelopes.ncl

Please let me know how to solve this.

Thanks,

Tabish

Tabish U Ansari
PhD student, Lancaster Environment Center
Lancaster Univeristy
Bailrigg, Lancaster,
LA1 4YW, United Kingdom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190208/f5feb1b1/attachment.html>


More information about the ncl-talk mailing list