<div dir="ltr"><div>Dear NCl,</div><div><br></div><div>I am trying to overlay two plots. But the significance plot does not show up, and there are no errors as such. I would be grateful if you could guide me on this.</div><div><br></div><div><br></div><div><br></div><div>;*******************************************</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;</div><div>;*******************************************</div><div><br></div><div>;*************************************************</div><div>;Reading in Storm track data by Peter Beinek 2016</div><div>;*************************************************</div><div> a=addfile(&quot;~/Documents/NCL_files/Storm_tracks/<a href="http://cyclcnt_monthly_80-14.nc">cyclcnt_monthly_80-14.nc</a>&quot;,&quot;r&quot;)</div><div><br></div><div> vNames = getfilevarnames(a) ; get variable names of all groups on file</div><div>      </div><div> ;print (vNames)               ; print all variable names on file</div><div> </div><div> dens=a-&gt;dens</div><div> time=a-&gt;time</div><div> lat=a-&gt;lat</div><div> lon=a-&gt;lon</div><div>;**************************************************</div><div>;Doing composite analysis for the years</div><div>;with high and low monsoon</div><div>;High rainfall years: 1990,1994,1999,2000,2001,2008,2013</div><div>;Low rainfall years: 1987,1991,2009,2012</div><div>;***************************************************</div><div><br></div><div>;***************************************************</div><div>;Now extracting the years with high rainfall</div><div>;***************************************************</div><div><br></div><div>;********************</div><div>;Extracting for 1990</div><div>;********************</div><div>st1990=dens({119:130},:,:)</div><div><br></div><div>;*******************</div><div>;Extracting for 1994</div><div>;*******************</div><div>st1994=dens({167:178},:,:)</div><div>;********************</div><div>;1999</div><div>;*******************</div><div>st1999=dens({227:238},:,:)</div><div>;********************</div><div>;2000</div><div>;*********************</div><div>st2000=dens({239:250},:,:)</div><div>;*********************</div><div>;2001</div><div>;********************</div><div>st2001=dens({251:262},:,:)</div><div>;********************</div><div>;2008</div><div>;********************</div><div>st2008=dens({335:346},:,:)</div><div>;********************</div><div>;2013</div><div>;*********************</div><div>st2013=dens({395:406},:,:)</div><div>;*********************</div><div><br></div><div>;*****************************************</div><div>;This averaging all the high years</div><div>;*****************************************</div><div><br></div><div>st_highyrs= [/st1990,st1994,st1999,st2000,st2001,st2008,st2013/] </div><div><br></div><div> ListSetType(st_highyrs, &quot;join&quot;) </div><div> jab = st_highyrs[:] </div><div>; print(dimsizes(jab)) </div><div> zAvg = dim_avg_n_Wrap(jab,0)  ; ==&gt; zAvg(12,nlat,nlon)</div><div>; print(dimsizes(zAvg))</div><div><br></div><div>zAvg!1=&quot;lat&quot; ; name dimensions </div><div>zAvg!2=&quot;lon&quot; </div><div>zAvg&amp;lat = dens&amp;lat ; assign coordinate values and </div><div>zAvg&amp;lon =dens&amp;lon ; units attributes </div><div> copy_VarAtts(dens,zAvg)   </div><div> copy_VarCoords_1(dens,zAvg)</div><div> zAvg&amp;lat@units = &quot;degrees_north&quot; </div><div> zAvg&amp;lon@units = &quot;degrees_east&quot; </div><div><br></div><div>;*********************************************</div><div>;Now reading in the years with low rainfall data </div><div>;For storm track 1987,1991,2009,2012</div><div>;**********************************************</div><div><br></div><div>;********************</div><div>;1987</div><div>;*********************</div><div>st1987=dens({83:94},:,:)</div><div>;*********************</div><div>;********************</div><div>;1991</div><div>;*********************</div><div>st1991=dens({131:142},:,:)</div><div>;*********************</div><div>;********************</div><div>;2009</div><div>;*********************</div><div>st2009=dens({335:346},:,:)</div><div>;*********************</div><div>;*********************</div><div>;2012</div><div>;*********************</div><div>st2012=dens({383:394},:,:)</div><div>;*********************</div><div>;*****************************************</div><div>;This averaging all the low years</div><div>;*****************************************</div><div><br></div><div>st_lowyrs= [/st1987,st1991,st2009,st2012/] </div><div><br></div><div>ListSetType(st_lowyrs, &quot;join&quot;) </div><div>jab1 = st_lowyrs[:] </div><div>;print(dimsizes(jab1))</div><div><br></div><div>;******************************************</div><div>;This is to calculate the std</div><div>;******************************************</div><div> zStd1=dim_stddev_n_Wrap( jab1, 0 ) </div><div><br></div><div>zAvg1 = dim_avg_n(jab1,0)  ; ==&gt; zAvg(12,nlat,nlon)</div><div><br></div><div>zAvg1!1=&quot;lat&quot; ; name dimensions </div><div>zAvg1!2=&quot;lon&quot; </div><div>zAvg1&amp;lat = dens&amp;lat ; assign coordinate values and </div><div>zAvg1&amp;lon =dens&amp;lon ; units attributes </div><div> copy_VarAtts(dens,zAvg1)   </div><div> copy_VarCoords_1(dens,zAvg1)</div><div> zAvg1&amp;lat@units = &quot;degrees_north&quot; </div><div> zAvg1&amp;lon@units = &quot;degrees_east&quot; </div><div><br></div><div><br></div><div>;******************************************</div><div>;Difference between high and low years</div><div>;******************************************</div><div><br></div><div>zDiff=zAvg-zAvg1</div><div><br></div><div>zDiff!1=&quot;lat&quot; ; name dimensions </div><div>zDiff!2=&quot;lon&quot; </div><div>zDiff&amp;lat = dens&amp;lat ; assign coordinate values and </div><div>zDiff&amp;lon =dens&amp;lon ; units attributes </div><div> copy_VarAtts(dens,zDiff)   </div><div> copy_VarCoords_1(dens,zDiff)</div><div> zDiff&amp;lat@units = &quot;degrees_north&quot; </div><div> zDiff&amp;lon@units = &quot;degrees_east&quot; </div><div> zDiff= smth9(zDiff, 0.5, 0.25, True)</div><div><br></div><div>  </div><div> ;*****************************************</div><div> ;Calculating significance test</div><div>  siglvl  = 0.05</div><div>  aveX    =dim_avg_n_Wrap(jab,0)         </div><div>  aveY    = dim_avg_n_Wrap(jab1,0)            </div><div>  varX    = dim_variance_n_Wrap( jab, 0 )       </div><div>  varY    = dim_variance_n_Wrap( jab1, 0 )        </div><div>  sX      = 7      </div><div>  sY      = 4</div><div>  </div><div>   alpha = 100.*(1. - ttest(aveX,varX,sX, aveY,varY,sY, True, False))  </div><div>   printMinMax(alpha,False)</div><div>   </div><div>; sig_ alpha = mask( alpha,  alpha.eq.100,False) </div><div>;sig_ alpha = mask( alpha,  alpha.le.90,False)</div><div>   </div><div>   </div><div>alpha!0=&quot;lat&quot; ; name dimensions </div><div>alpha!1=&quot;lon&quot; </div><div>alpha&amp;lat = dens&amp;lat ; assign coordinate values and </div><div>alpha&amp;lon =dens&amp;lon ; units attributes </div><div> copy_VarAtts(dens,alpha)   </div><div> copy_VarCoords_1(dens,alpha)</div><div>alpha&amp;lat@units = &quot;degrees_north&quot; </div><div> alpha&amp;lon@units = &quot;degrees_east&quot; </div><div>   </div><div>;**************************************************</div><div>; Now plotting the storm track</div><div>;**************************************************</div><div>;*************************************************   </div><div>  plot = new(2,graphic)   </div><div>                  </div><div>  ;************************************************</div><div>; create plot</div><div>;************************************************</div><div> wks = gsn_open_wks(&quot;X11&quot;,&quot;Composite_high_low_storm_tracks_sig_dec_april&quot;)               ; </div><div><br></div><div> gsn_define_colormap(wks, &quot;BlueWhiteOrangeRed&quot;) </div><div> </div><div>;************************************************</div><div>;Composite</div><div>;************************************************</div><div>   res                     = True</div><div>  res@gsnDraw             = False            ; don&#39;t draw</div><div>  res@gsnFrame            = False            ; don&#39;t advance frame</div><div>  res@cnFillOn             = True                ; turn on color</div><div>  res@cnLinesOn            = False               ; turn off contour lines</div><div>  res@cnLevelSpacingF      = 0.1                   ; contour interval</div><div>  res@cnLevelSelectionMode = &quot;ManualLevels&quot;;</div><div>  res@cnMinLevelValF       = -0.5             ; min level</div><div>  res@cnMaxLevelValF       =0.5</div><div>  res@mpMinLatF          = 30          ; choose a subregion</div><div>  res@mpMaxLatF          = 90.</div><div>  res@mpMinLonF          = 0         ; choose a subregion</div><div>  res@mpMaxLonF          = 180.</div><div>  res@lbLabelBarOn        = False           ; turn off individual cb&#39;s</div><div> </div><div>;*****************************************************</div><div>;Significance</div><div>;*****************************************************</div><div>  res1                     = True</div><div> res1@gsnDraw              = False           ; Do not draw plot</div><div> res1@gsnFrame             = False           ; Do not advance frome   </div><div> res1@cnFillOn             = True</div><div> res1@cnMonoFillColor      = True</div><div> res1@cnMonoFillPattern    = False</div><div> res1@lbLabelBarOn        = False                            ; turn off label bar</div><div> res1@cnLevelSelectionMode = &quot;ManualLevels&quot;   ; manually specify contour levels</div><div> res1@cnMinLevelValF       = 95             ; min level</div><div> res1@cnMaxLevelValF       = 100             ; max level</div><div> res1@cnLevelSpacingF      =  1              ; contour interval</div><div> res1@gsnSpreadColors      = False</div><div> res1@cnInfoLabelOn       = False       ; turn off info label</div><div> res@cnLineLabelsOn = False</div><div> res1@cnFillPatterns       =  (/17,17,17,17,17,17,17,17,17,17/)</div><div><br></div><div> </div><div>  scale   = 1.0</div><div>  dotsize = 0.003  </div><div>  res1@cnFillScaleF   = scale</div><div>  res1@cnFillDotSizeF = dotsize</div><div>  ;****************************************************</div><div>  </div><div>  </div><div>  </div><div>  plotA= gsn_csm_contour_map(wks,zDiff(3,:,:), res)  ;</div><div>  plotB =  gsn_csm_contour(wks,alpha(3,:,:),res1)  ; create plot</div><div>   overlay(plotA,plotB)                      ; result will be plotA</div><div>  plot(0) = plotA </div><div>  </div><div>  plotC = gsn_csm_contour_map(wks,zDiff(11,:,:), res)  ;</div><div>  plotD =  gsn_csm_contour(wks,alpha(11,:,:),res1)  ; create plot</div><div>  </div><div>  overlay (plotC, plotD) </div><div>  plot(1) = plotC     </div><div>   </div><div><br></div><div> </div><div>   </div><div>  resP                    = True                 ; modify the panel plot</div><div> resP@gsnFrame           = False                ; don&#39;t advance panel plot</div><div>  </div><div> </div><div>resP@gsnPanelFigureStrings= (/ &quot;April&quot; ,&quot;December&quot;/) ;</div><div>resP@gsnPanelFigureStringsFontHeightF=0.01</div><div>resP@amJust   = &quot;TopLeft&quot;</div><div>resP@gsnPanelFigureStringsBackgroundFillColor = (/-1/)</div><div>resP@txString           = &quot;Storm tracks difference between high and low MJ years&quot; </div><div>resP@gsnPanelLabelBar    = True                ; add common colorbar</div><div>resP@lbLabelFontHeightF  = 0.01               ; make labels smaller</div><div>resP@lbOrientation       = &quot;vertical&quot; ; vertical label bar</div><div> ;</div><div>  gsn_panel(wks,plot,(/2,1/),resP)      </div><div><br></div><div><br></div><div> frame(wks)  </div><div>;===========================================</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><div><div>Ipshita Majhi<br></div>PhD Candidate<br></div>University of Alaska , Fairbanks<br></div>Atmospheric Science Department<br></div>(907)978-4220 <a href="mailto:ipmajhi@alaska.edu" target="_blank">ipmajhi@alaska.edu</a><br></div></div>
</div>