<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:large">Hello NCl Users, I am new to ncl and I have a problem. I am trying to make a  plot similar to the one attached with a common color bar and the file contains precipitation data from 1991-2005. Here&#39;s what I have done so far. <br><br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;  <br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;  <br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot; <br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl&quot; <br><br>wksType = &quot;pdf&quot;<br>   wksName = &quot;climo123&quot;                          ; &quot;: &quot;+yrStrt+&quot;_&quot;+yrLast<br>  <br>   diri    = &quot;/media/kwesi/Maxtor/paper/&quot;         ; input directory   <br><br><br>;***********************************************************<br>; Read first file; Create climatology for desired period<br>;***********************************************************<br><br>   fili    = &quot;CCCma91-05.nc3&quot;<br>   f       = addfile (diri+fili , &quot;r&quot;)                          <br><br>   pr     = f-&gt;pr*86400     ; (time,lat,lon)<br>   time    = f-&gt;time<br>   lat     = f-&gt;lat<br>   lon     = f-&gt;lon <br><br>   ntim = dimsizes(time)<br>   pr!0 = &quot;time&quot;<br>   pr!1 = &quot;lat&quot;<br>   pr!2 = &quot;lon&quot;<br>   pr&amp;time = time<br>   pr&amp;lat = lat<br>   pr&amp;lon = lon<br>              <br>   months = (/&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot; \<br>            ,&quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;Auguat&quot;         \<br>            ,&quot;September&quot;, &quot;October&quot;, &quot;November&quot;      \<br>            ,&quot;December&quot; /)                       <br>   prClm  = clmMonTLL( pr)                  ; Climatology<br>                                              <br>   delete(time)<br>   delete(pr)<br><br>   printVarSummary( prClm )<br>   printMinMax( prClm, True )<br><br>;***********************************************************<br>; Read second file ; Create climatology for desired period<br>; <br>;***********************************************************<br><br>   fili    = &quot;Cnrm91-05.nc3&quot;<br>   f       = addfile (diri+fili , &quot;r&quot;)                          <br>   pr      = f-&gt;pr*86400     ; (time,lat,lon)<br>   time    = f-&gt;time<br>   lat     = f-&gt;lat<br>   lon     = f-&gt;lon <br><br>   ntim = dimsizes(time)<br>   pr!0 = &quot;time&quot;<br>   pr!1 = &quot;lat&quot;<br>   pr!2 = &quot;lon&quot;<br>   pr&amp;time = time<br>   pr&amp;lat = lat<br>   pr&amp;lon = lon <br>   months = (/&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot; \<br>            ,&quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;Auguat&quot;         \<br>            ,&quot;September&quot;, &quot;October&quot;, &quot;November&quot;      \<br>            ,&quot;December&quot; /)                         <br><br>   prClm  = clmMonTLL( pr)                  ; Climatology<br>                                              <br>   delete(time)<br>   delete(pr)<br><br>   printVarSummary( prClm )<br>   printMinMax( prClm, True )<br><br>;***********************************************************<br>; Read third file; Create climatology for desired period<br>;***********************************************************<br><br>   fili    = &quot;Ichec91-05.nc3&quot;<br>   f       = addfile (diri+fili , &quot;r&quot;)                          <br><br>   pr      = f-&gt;pr*86400     ; (time,lat,lon)<br>   time    = f-&gt;time<br>   lat     = f-&gt;lat<br>   lon     = f-&gt;lon <br><br>   ntim = dimsizes(time)<br>   pr!0 = &quot;time&quot;<br>   pr!1 = &quot;lat&quot;<br>   pr!2 = &quot;lon&quot;<br>   pr&amp;time = time<br>   pr&amp;lat = lat<br>   pr&amp;lon = lon                        <br><br>   months = (/&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot; \<br>            ,&quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;Auguat&quot;         \<br>            ,&quot;September&quot;, &quot;October&quot;, &quot;November&quot;      \<br>            ,&quot;December&quot; /)<br>   prClm  = clmMonTLL( pr)                  ; Climatology<br>                                              <br>   ;delete(time)<br>   delete(pr)<br><br>   printVarSummary( prClm )<br>   printMinMax( prClm, True )<br><br>;*************************************************<br>; create colors<br>;*************************************************<br> <br><br>  colors = (/&quot;white&quot;,&quot;black&quot;             \      ; back/fore ground<br>            ,&quot;azure1&quot;,&quot;beige&quot;,&quot;lavender&quot; \<br>            ,&quot;PaleGreen&quot;,&quot;SeaGreen3&quot;,&quot;LightYellow&quot; \<br>            ,&quot;Yellow&quot;,&quot;HotPink&quot;,&quot;Red&quot;/)         ; choose colors for color map<br>            wks = gsn_open_wks(wksType, wksName)<br>  gsn_define_colormap(wks, colors)              ; generate new color map<br><br>;************************************************<br>; create panel plots<br>;*************************************************<br>  plot   = new (3 , graphic)                    ; create graphical array<br><br>  res                      = True               ; plot options desired<br><br>  res@cnFillOn             = True               ; turn on color fill<br>  res@cnInfoLabelOn        = False              ; turn off contour info label<br>  res@cnLinesOn            = False              ; turn off contour lines<br>  res@cnLineLabelsOn       = False              ; turn off line labels<br>  res@cnLevelSelectionMode = &quot;ExplicitLevels&quot;   ; set explicit contour levels<br>  res@cnLevels             = (/ 2.0, 2.5 \ ; set unequal contour levels<br>                              , 3.0, 3.5, 4.0, 4.5, 5.0 \<br>                              ,5.5, 6.0, 6.5, 7.0, 7.5,10.0 /)<br><br>                             <br><br>  res@mpFillOn             = False              ; turn off gray continents<br>  ;res@mpCenterLonF         = 180                ; Centers the plot at 180 <br> <br>  res@lbLabelBarOn         = False              ; No single label bar<br><br>  res@gsnDraw              = False<br>  res@gsnFrame             = False<br><br>  resP                     = True               ; panel options<br>  resP@txString            = &quot;GPCC Precipitation: Climatology&quot;   ; common title<br>  resP@gsnMaximize         = True               ; maximize image<br>  resP@gsnPanelLabelBar    = True               ; Add common label bar <br><br>;---Set to False if plotting regional data or setting sfXArray/sfYArray<br>  res@gsnAddCyclic      =False<br><br>  res@sfXArray          = lon   ; Only necessary if x doesn&#39;t <br>  res@sfYArray          = lat   ; contain 1D coordinate arrays<br>;<br>; Zoom in on map if desired. There are other ways to zoom in on<br>; map if you have a different projection, like lambert conformal.<br>;<br>  res@mpMinLatF         = -60<br>  res@mpMaxLatF         = 0<br>  res@mpMinLonF         = -20<br>  res@mpMaxLonF         = 60<br>  ;res@mpCenterLonF      = (res@mpMinLonF + res@mpMaxLonF) / 2.<br><br>  ;i = -1                                        ; Climatologies<br>  ;do nmo=0,180                                 ; loop over the months<br>     ;i = i+1<br>     ;res@gsnCenterString   = months(nmo)+&quot;:&quot;+time(0)/100 +&quot;-&quot;+ time(ntim-1)/100<br>     ;plot(i) = gsn_csm_contour_map_ce(wks,prClm(nmo,:,:), res)  ; create plot<br>  ;end do<br>plot = gsn_csm_contour_map_ce(wks,prClm(0,:,:), res)  ; create plot<br>  gsn_panel(wks,plot,(/3,1/),resP)<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:large">-------After running the script I get<br clear="all"></div>Variable: prClm<br>Type: float<br>Total Size: 1486416 bytes<br>            371604 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [month | 12] x [lat | 179] x [lon | 173]<br>Coordinates: <br>            month: [0..11]<br>            lat: [-46.25..42.75]<br>            lon: [-25.25..60.75]<br>Number Of Attributes: 3<br>  _FillValue :    1e+20<br>  time_op_ncl :    Climatology: 15 years<br>  info :    function clmMonLLT: contributed.ncl<br>(0)     <br>(0)    min=0   max=63.1759<br><br>Variable: prClm<br>Type: float<br>Total Size: 1486416 bytes<br>            371604 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [month | 12] x [lat | 179] x [lon | 173]<br>Coordinates: <br>            month: [0..11]<br>            lat: [-46.25..42.75]<br>            lon: [-25.25..60.75]<br>Number Of Attributes: 3<br>  info :    function clmMonLLT: contributed.ncl<br>  time_op_ncl :    Climatology: 15 years<br>  _FillValue :    1e+20<br>(0)     <br>(0)    min=0   max=69.7658<br><br>Variable: prClm<br>Type: float<br>Total Size: 1486416 bytes<br>            371604 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [month | 12] x [lat | 179] x [lon | 173]<br>Coordinates: <br>            month: [0..11]<br>            lat: [-46.25..42.75]<br>            lon: [-25.25..60.75]<br>Number Of Attributes: 3<br>  info :    function clmMonLLT: contributed.ncl<br>  time_op_ncl :    Climatology: 15 years<br>  _FillValue :    1e+20<br>(0)     <br>(0)    min=0   max=53.8587<br><div style="font-family:trebuchet ms,sans-serif;font-size:large" class="gmail_default">​ and the file named climo123 as attached.​ Any help will be much appreciated.</div><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><div><font color="#0000ff" face="trebuchet ms, sans-serif">Try not to become a man of success but rather a man of value-Albert Einstein</font></div><div><font color="#0000ff" face="trebuchet ms, sans-serif"><br></font></div><div><font color="#0000ff"><font face="trebuchet ms, sans-serif">University of Cape Coast|</font><span style="font-family:&quot;trebuchet ms&quot;,sans-serif;font-size:12.8px">College of Agriculture and Natural Sciences|</span><span style="font-family:&quot;trebuchet ms&quot;,sans-serif;font-size:12.8px">Department of Physics|</span></font></div><div><font color="#0000ff" face="trebuchet ms, sans-serif">Team Leader|Recycle Up! Ghana|Technology Without Borders|</font></div><div><font color="#0000ff"><font face="trebuchet ms, sans-serif">Other emails: </font><span style="font-family:&quot;trebuchet ms&quot;,sans-serif;font-size:12.8px"><a href="mailto:kwesi.quagraine@ucc.edu.gh" target="_blank">kwesi.quagraine@ucc.edu.gh</a>|</span><span style="font-family:&quot;trebuchet ms&quot;,sans-serif;font-size:12.8px"><a href="mailto:kwesi.quagraine@teog.de" target="_blank">kwesi.quagraine@teog.de</a>|</span></font></div><div><span style="font-family:&quot;trebuchet ms&quot;,sans-serif;font-size:12.8px"><font color="#0000ff">Mobile: +233266173582</font></span></div></div><div><font color="#0000ff" face="trebuchet ms, sans-serif">Skype: quagraine_cwasi</font></div><div><font color="#0000ff" face="trebuchet ms, sans-serif">Twitter: @Pkdilly</font></div><div><br><img src="cid:ii_1596513231e8f873" alt="Inline image 1" width="387" height="334"></div></div></div></div></div></div></div></div>
</div>