From M.Lazenby at sussex.ac.uk Fri Feb 3 05:14:45 2023 From: M.Lazenby at sussex.ac.uk (Melissa Lazenby) Date: Fri, 3 Feb 2023 12:14:45 +0000 Subject: [ncl-talk] Issue with making multiple bar plots on one time series Message-ID: Dear All NCL Users I hope you are well. I am trying to make a bar plot that has 4 bars per year in a times series from 1856-1889. I have managed to make a plot however the bars are overlaying on one another, and I would like them side by side like the example unique_5. I have used the fspan option like the example for unique 5 does but it does not seem to be working. I also am having issues with my x axis labels being the years. Any help to rectify this issue would be greatly appreciated. Below are the output of the figure and code. Many thanks! Kindest Regards Melissa [cid:ca412424-01ff-428f-aa69-83fa199caebf] ;******************************************************* ; Mpwapwa_unique_5.ncl ; ; Concepts illustrated: ; - Drawing multiple bar charts on a page ; - Drawing three custom legends outside a bar chart ; - Using bar charts to draw standard deviations for four time series ; - Drawing a time series plot ;******************************************************* ; ; These files are loaded by default in NCL V6.2.0 and newer ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin x = (/1856,?1857,?1858,?1859,?1860,?1861,?1862,?1863,?1864,?1865,?1866,?1867,?1868,?1869,?1870,?1871,?1872,?1873,?1874,?1875,?1876,?1877,?1878,?1879,?1880,?1881,?1882,?1883,?1884,?1885,?1886,?1887,?1888,?1889/) yIndex = (/0,2,-1,-3,2,0,0,0,0,0,0,0,0,0,0,0,2,0,-1,-1,-2,1,1,-2,-2,1,-1,-3,0,0,0,-3,0,0/) y20CR3 = (/-1.7049024,??-1.9956352,?0.1017878,??1.5787968,??0.2902762,??0.1615032,??0.7573914,??0.127654184,??????0.3391526,??0.18975348,?1.4533978,??0.28738338,?0.8228474,??-1.2142216,?0.67589808,?1.3983746,??1.1087944,??0.58095216,?-1.3422622,?0.226781852,??????2.173188,???0.6511904,??0.9723054,??-0.4989326,?-1.5402072,?-0.1535788,?-0.226605,??-1.6808838,?-0.19809544,??????-0.1772666,?0.0769234,??-0.6346154,?-1.2222682,?-0.0073483/) ;scaled by 10 yLMR = (/0.54,????-0.0624672,?-0.0590976,?0.322272,???-1.14912,???0.863136,???0.7776,?????1.2528,?????-0.0831168,?1.19232,????0.03024,????0.507168,???0.96768,????0.63504,????1.43424,????1.79712,????0.555552,???0.478656,???1.0368,?????0.679104,???0.1944,?????0.292896,???0.9936,?????1.08,?1.18368,????1.26144,????0.631584,???-0.627264,??-0.97632,???-0.325728,??0.00860544,?-0.800928,??-0.0360288,?0.186624/) ;scaled by 5 yCMIP5 = (/-0.9094243, 0.5458735, -0.8682191, -1.826278, -0.6501346, 0.1305088, 0.51643, 0.6247665, -0.4082086, 0.3641764, 1.476322, 0.842743, -0.5013026, -0.1281874, 0.4829363, -0.7015711, 0.269588, -0.2834916, -0.8827865, -0.4242322, -1.171241, -0.8289737, -0.4638377, 0.8812776, 0.5154026, -1.191759 ,0.8223722, -1.198702, -0.8878552, -1.724694, -1.62958, 1.02131, -1.440305, -2.299565/) ;yCMIP5 = (/-1.329231, -0.9094243, 0.5458735, -0.8682191, -1.826278, -0.6501346, 0.1305088, 0.51643, 0.6247665, -0.4082086, 0.3641764, 1.476322, 0.842743, -0.5013026, -0.1281874, 0.4829363, -0.7015711, 0.269588, -0.2834916, -0.8827865, -0.4242322, -1.171241, -0.8289737, -0.4638377, 0.8812776, 0.5154026, -1.191759 ,0.8223722, -1.198702, -0.8878552, -1.724694, -1.62958, 1.02131, -1.440305, -2.299565/) stdarr = new((/34,4/),"float") do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) stdarr(hh,1) = (/ (y20CR3(hh::34)) /) stdarr(hh,2) = (/ (yLMR(hh::34)) /) ??????stdarr(hh,3) = (/ (yCMIP5(hh::34)) /) end do print("Index Data = "+dimsizes(yIndex)+", 20CR3 = "+dimsizes(y20CR3)+", LMR = "+dimsizes(yLMR)+", CMIP5 = "+dimsizes(yCMIP5)) ;======================================================================================??? wks = gsn_open_wks("X11","Mpwapwa_4_Plot") ; send graphics to PNG file sres = True sres at vpWidthF = 0.7 sres at vpHeightF = 0.5 sres at vpXF = .15 sres at trYMinF = -3.5 sres at trYMaxF = 3.5 sres at gsnDraw = True sres at gsnFrame = False sres at gsnXYBarChart = True sres at gsnXYBarChartBarWidth = 0.20 ; change bar widths sres at tmXBMode = "Explicit" ; explicit labels sres at tmXBValues = (/1856,????1857,?1858,?1859,?1860,?1861,?1862,?1863,?1864,?1865,?1866,?1867,?1868,?1869,?1870,?1871,?1872,?1873,?1874,?1875,?1876,?1877,?1878,?1879,?1880,?1881,?1882,?1883,?1884,?1885,?1886,?1887,?1888,?1889/) ;sres at tmXBValues = (/1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34/) sres at tmXBLabels = (/"1856","1857","1858",??"1859",?????"1860",?????"1861",?????"1862",?????"1863",?????"1864",?????"1865",?????"1866",?????"1867",?????"1868",?????"1869",?????"1870",?????"1871",?????"1872",?????"1873",?????"1874",?????"1875",?????"1876",?????"1877",?????"1878",?????"1879",?????"1880",?????"1881",?????"1882",?????"1883",?????"1884",?????"1885",?????"1886",?????"1887",?????"1888",?????"1889"/) sres at tmXBLabelFontHeightF = 0.0205 sres at tmXTLabelFontHeightF = 0.0205 sres at tmYLLabelFontHeightF = 0.0225 sres at tiMainFontHeightF = 0.025 sres at tiMainFont = "helvetica" sres at tiMainString = "Precipitation Anomalies for all 4 datasets" sres at gsnRightString = "" sres at tiYAxisString = "Pr Anomalies (mm/day)" sres at gsnYRefLine = 0. ; reference line sres at gsnXYBarChartColors = (/"red"/)? plot1 = gsn_csm_xy(wks,fspan(.775,33.775,34),stdarr(:,0),sres)???????????; draw each time series sres at gsnXYBarChartColors = (/"lightblue"/)?????????????????????????; seperately, not plot2 = gsn_csm_xy(wks,fspan(.925,33.925,34),stdarr(:,1),sres)???????????; advancing the frame sres at gsnXYBarChartColors = (/"blue"/)??????????????????????????????; but tweaking where plot3 = gsn_csm_xy(wks,fspan(1.075,34.075,34),stdarr(:,2),sres)??????????; each time series is sres at gsnXYBarChartColors = (/"green"/)?????????????????????????????; drawn on the X-axis plot4 = gsn_csm_xy(wks,fspan(1.225,34.225,34),stdarr(:,3),sres) lbres = True ; labelbar only resources lbres at vpWidthF = 0.2 ; labelbar width lbres at vpHeightF = 0.1 ; labelbar height lbres at lbBoxMajorExtentF = 0.36 ; puts space between color boxes lbres at lbFillColors = (/"green","blue"/) lbres at lbMonoFillPattern = True ; Solid fill pattern lbres at lbLabelFontHeightF = 0.025 ; font height. default is small lbres at lbLabelJust = "CenterLeft" ; left justify labels lbres at lbPerimOn = False lbres at lgPerimColor ?????? = "white" labels = (/"CMIP5","20CR3"/) gsn_labelbar_ndc(wks,2,labels,0.52,0.23,lbres)???; draw right labelbar column ?????? lbres at lbFillColors = (/"lightblue","red"/) labels = (/"LMR","Index"/) gsn_labelbar_ndc(wks,2,labels,0.17,0.23,lbres)???; draw left labelbar column frame(wks) end Dr. Melissa Lazenby Lecturer in Climate Change Department of Geography Chichester 1 C150 University of Sussex "Education is the most powerful weapon which you can use to change the world" Nelson Mandela [cid:d803561d-88ff-4fe1-9c8c-2ccee5c3b54c] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 35799 bytes Desc: image.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Outlook-j11uarkt.png Type: image/png Size: 24937 bytes Desc: Outlook-j11uarkt.png URL: From asphilli at ucar.edu Fri Feb 3 10:04:43 2023 From: asphilli at ucar.edu (Adam Phillips) Date: Fri, 3 Feb 2023 10:04:43 -0700 Subject: [ncl-talk] Issue with making multiple bar plots on one time series In-Reply-To: References: Message-ID: Hi Melissa, It looks to me like you are close. The range of XBValues needs to match the range X-axis inputs in the gsn_csm_xy call. It looks like you have tried different permutations of this. For simplicity of the x-axis labels I would go with the 1856-1889 values. I also believe that it would be best to set the trXMinF/trXMaxF resources so that each set of bars is overlaid on the exact same plot window with the same min/max values, otherwise NCL will automatically set these resources. I think this is why your bars are being set on top of one another. So I'd give this a try: sres at trXMinF = 1855 sres at trXMaxF = 1890 sres at tmXBValues = ispan(1855,1890,5) ; create major tickmarks with labels every 5 years sres at tmXBLabels = sres at tmXBValues sres at tmXBMinorValues = ispan(1855,1890,1). ; as tmXBMode = "Explicit", this resource needs to be set to get minor tickmarks. Create minor tickmarks every year. sres at gsnXYBarChartColors = (/"red"/) plot1 = gsn_csm_xy(wks,fspan(1855.7,1888.7,34),stdarr(:,0),sres) ; draw each time series sres at gsnXYBarChartColors = (/"lightblue"/) ; seperately, not plot2 = gsn_csm_xy(wks,fspan(1855.9,1888.9,34),stdarr(:,1),sres) ; advancing the frame sres at gsnXYBarChartColors = (/"blue"/) ; but tweaking where plot3 = gsn_csm_xy(wks,fspan(1856.1,1889.1,34),stdarr(:,2),sres) ; each time series is sres at gsnXYBarChartColors = (/"green"/) ; drawn on the X-axis plot4 = gsn_csm_xy(wks,fspan(1856.2,1889.2,34),stdarr(:,3),sres) I tweaked the fspan settings above to sit within the range of tmXBValues, and to reflect that you set sres at gsnXYBarChartBarWidth=.2. For instance, the first bar in plot1 should run from 1855.6-1855.8, the first bar in plot2 should run from 1855.8-1856, and so on so that they are all grouped together for each timestep. You might have to tweak some other settings, but this should get you started at the very least. Good luck! Adam On Fri, Feb 3, 2023 at 5:14 AM Melissa Lazenby via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Dear All NCL Users > > I hope you are well. > I am trying to make a bar plot that has 4 bars per year in a times series > from 1856-1889. > I have managed to make a plot however the bars are overlaying on one > another, and I would like them side by side like the example unique_5. > I have used the fspan option like the example for unique 5 does but it > does not seem to be working. > I also am having issues with my x axis labels being the years. > Any help to rectify this issue would be greatly appreciated. Below are the > output of the figure and code. > > Many thanks! > > Kindest Regards > Melissa > > > ;******************************************************* > ; Mpwapwa_unique_5.ncl > ; > ; Concepts illustrated: > ; - Drawing multiple bar charts on a page > ; - Drawing three custom legends outside a bar chart > ; - Using bar charts to draw standard deviations for four time series > ; - Drawing a time series plot > ;******************************************************* > ; > ; These files are loaded by default in NCL V6.2.0 and newer > ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" > ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" > > begin > > > x = (/1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, > 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, > 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889/) > > yIndex = > (/0,2,-1,-3,2,0,0,0,0,0,0,0,0,0,0,0,2,0,-1,-1,-2,1,1,-2,-2,1,-1,-3,0,0,0,-3,0,0/) > > y20CR3 = (/-1.7049024, -1.9956352, 0.1017878, 1.5787968, 0.2902762, > 0.1615032, 0.7573914, 0.127654184, 0.3391526, 0.18975348, 1.4533978, > 0.28738338, 0.8228474, -1.2142216, 0.67589808, 1.3983746, 1.1087944, > 0.58095216, -1.3422622, 0.226781852, 2.173188, 0.6511904, 0.9723054, > -0.4989326, -1.5402072, -0.1535788, -0.226605, -1.6808838, -0.19809544, > -0.1772666, 0.0769234, -0.6346154, -1.2222682, -0.0073483/) > > > ;scaled by 10 > yLMR = (/0.54, -0.0624672, -0.0590976, 0.322272, -1.14912, 0.863136, > 0.7776, 1.2528, -0.0831168, 1.19232, 0.03024, 0.507168, 0.96768, 0.63504, > 1.43424, 1.79712, 0.555552, 0.478656, 1.0368, 0.679104, 0.1944, 0.292896, > 0.9936, 1.08, 1.18368, 1.26144, 0.631584, -0.627264, -0.97632, -0.325728, > 0.00860544, -0.800928, -0.0360288, 0.186624/) > > > ;scaled by 5 > yCMIP5 = (/-0.9094243, 0.5458735, -0.8682191, -1.826278, -0.6501346, > 0.1305088, 0.51643, 0.6247665, -0.4082086, 0.3641764, 1.476322, 0.842743, > -0.5013026, -0.1281874, 0.4829363, -0.7015711, 0.269588, -0.2834916, > -0.8827865, -0.4242322, -1.171241, -0.8289737, -0.4638377, 0.8812776, > 0.5154026, -1.191759 ,0.8223722, -1.198702, -0.8878552, -1.724694, > -1.62958, 1.02131, -1.440305, -2.299565/) > > ;yCMIP5 = (/-1.329231, -0.9094243, 0.5458735, -0.8682191, -1.826278, > -0.6501346, 0.1305088, 0.51643, 0.6247665, -0.4082086, 0.3641764, 1.476322, > 0.842743, -0.5013026, -0.1281874, 0.4829363, -0.7015711, 0.269588, > -0.2834916, -0.8827865, -0.4242322, -1.171241, -0.8289737, -0.4638377, > 0.8812776, 0.5154026, -1.191759 ,0.8223722, -1.198702, -0.8878552, > -1.724694, -1.62958, 1.02131, -1.440305, -2.299565/) > > > stdarr = new((/34,4/),"float") > do hh = 0,33 > stdarr(hh,0) = (/ (yIndex(hh::34)) /) > stdarr(hh,1) = (/ (y20CR3(hh::34)) /) > stdarr(hh,2) = (/ (yLMR(hh::34)) /) > stdarr(hh,3) = (/ (yCMIP5(hh::34)) /) > end do > print("Index Data = "+dimsizes(yIndex)+", 20CR3 = > "+dimsizes(y20CR3)+", LMR = "+dimsizes(yLMR)+", CMIP5 = "+dimsizes(yCMIP5)) > > ;====================================================================================== > > wks = gsn_open_wks("X11","Mpwapwa_4_Plot") ; send graphics > to PNG file > > sres = True > sres at vpWidthF = 0.7 > sres at vpHeightF = 0.5 > sres at vpXF = .15 > sres at trYMinF = -3.5 > sres at trYMaxF = 3.5 > sres at gsnDraw = True > sres at gsnFrame = False > sres at gsnXYBarChart = True > sres at gsnXYBarChartBarWidth = 0.20 ; change bar widths > sres at tmXBMode = "Explicit" ; explicit labels > sres at tmXBValues = (/1856, 1857, 1858, 1859, 1860, 1861, > 1862, 1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, > 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 1885, > 1886, 1887, 1888, 1889/) > ;sres at tmXBValues = > (/1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34/) > sres at tmXBLabels = (/"1856","1857","1858", "1859", "1860", "1861", > "1862", "1863", "1864", "1865", "1866", "1867", "1868", "1869", "1870", > "1871", "1872", "1873", "1874", "1875", "1876", "1877", "1878", "1879", > "1880", "1881", "1882", "1883", "1884", "1885", "1886", "1887", "1888", > "1889"/) > sres at tmXBLabelFontHeightF = 0.0205 > sres at tmXTLabelFontHeightF = 0.0205 > sres at tmYLLabelFontHeightF = 0.0225 > sres at tiMainFontHeightF = 0.025 > sres at tiMainFont = "helvetica" > sres at tiMainString = "Precipitation Anomalies for all 4 datasets" > sres at gsnRightString = "" > sres at tiYAxisString = "Pr Anomalies (mm/day)" > sres at gsnYRefLine = 0. ; reference line > > sres at gsnXYBarChartColors = (/"red"/) > plot1 = gsn_csm_xy(wks,fspan(.775,33.775,34),stdarr(:,0),sres) ; draw > each time series > sres at gsnXYBarChartColors = (/"lightblue"/) ; seperately, not > plot2 = gsn_csm_xy(wks,fspan(.925,33.925,34),stdarr(:,1),sres) ; > advancing the frame > sres at gsnXYBarChartColors = (/"blue"/) ; but tweaking where > plot3 = gsn_csm_xy(wks,fspan(1.075,34.075,34),stdarr(:,2),sres) ; > each time series is > sres at gsnXYBarChartColors = (/"green"/) ; drawn on the X-axis > plot4 = gsn_csm_xy(wks,fspan(1.225,34.225,34),stdarr(:,3),sres) > > lbres = True ; labelbar only resources > lbres at vpWidthF = 0.2 ; labelbar width > lbres at vpHeightF = 0.1 ; labelbar height > lbres at lbBoxMajorExtentF = 0.36 ; puts space between color > boxes > lbres at lbFillColors = (/"green","blue"/) > lbres at lbMonoFillPattern = True ; Solid fill pattern > lbres at lbLabelFontHeightF = 0.025 ; font height. default is > small > lbres at lbLabelJust = "CenterLeft" ; left justify labels > lbres at lbPerimOn = False > lbres at lgPerimColor = "white" > labels = (/"CMIP5","20CR3"/) > gsn_labelbar_ndc(wks,2,labels,0.52,0.23,lbres) ; draw right labelbar > column > lbres at lbFillColors = (/"lightblue","red"/) > labels = (/"LMR","Index"/) > gsn_labelbar_ndc(wks,2,labels,0.17,0.23,lbres) ; draw left labelbar > column > frame(wks) > end > > > Dr. Melissa Lazenby > Lecturer in Climate Change > Department of Geography > Chichester 1 C150 > University of Sussex > > *"Education is the most powerful weapon which you can use to change the > world" Nelson Mandela* > > > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -- Adam Phillips Associate Scientist IV, Climate Analysis Section Climate and Global Dynamics Laboratory National Center for Atmospheric Research www.cgd.ucar.edu/staff/asphilli/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 35799 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Outlook-j11uarkt.png Type: image/png Size: 24937 bytes Desc: not available URL: From michael.toy at noaa.gov Mon Feb 6 15:35:16 2023 From: michael.toy at noaa.gov (Michael Toy - NOAA Affiliate) Date: Mon, 6 Feb 2023 15:35:16 -0700 Subject: [ncl-talk] Issues with NCL and latest version of XQuartz X11? Message-ID: Hello, I just recently updated to XQuartz version 2.8.5 on my Mac, and since then NCL is not able to plot to an X11 window. The plot begins to draw, but then freezes. When I plot to a file, such as ?pdf?, the plot comes out fine. Does anybody know if there is now an incompatibility between NCL (v6.6.2) and XQuartz? Thanks, Mike ? ? ? ? ? ? ? ? ? Michael Toy, Research Scientist CIRES, University of Colorado Boulder NOAA Global Systems Laboratory 325 Broadway, Boulder, Colorado Michael.Toy at noaa.gov +1-505-609-8782 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1505 bytes Desc: not available URL: From xi.chang01 at gmail.com Mon Feb 6 17:17:48 2023 From: xi.chang01 at gmail.com (Xi Chang) Date: Mon, 6 Feb 2023 16:17:48 -0800 Subject: [ncl-talk] get first index of each sequence Message-ID: Hi NCL community, Is there anyone who can help me on how to return the first index of each sequence in 1D data? For example, x = (/-999,-999,-999,-999,1,1,1,1,1,-999,-999,-999,1,1,1,-999,1,1,1/) x at _FillValue=-999 There are 3 sequences of data in that 1D time series, how could I get the first index of each sequence, so that the answer would be: (0) 4 (1) 12 (2) 16 Thanks Chang -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.allured at noaa.gov Mon Feb 6 18:01:19 2023 From: dave.allured at noaa.gov (Dave Allured - NOAA Affiliate) Date: Mon, 6 Feb 2023 20:01:19 -0500 Subject: [ncl-talk] get first index of each sequence In-Reply-To: References: Message-ID: When analyzing sequences, it is often useful to compare adjacent elements by using a vector shifted by one position. Then find an expression that is true in the positions of interest, and false everywhere else. status = .not. ismissing (x) nx = dimsizes (x) previous = new (nx, logical) previous(0) = False ; need this to get correct answer for first position previous(1:nx-1) = status(0:nx-2) ; vector shifted one position to the right change = status(:) .and. .not. previous(:) ; all places that changed from missing to not istarts = ind (change) print (istarts+"") (0) 4 (1) 12 (2) 16 On Mon, Feb 6, 2023 at 7:18 PM Xi Chang via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hi NCL community, > > Is there anyone who can help me on how to return the first index of each > sequence in 1D data? > For example, > > x = (/-999,-999,-999,-999,1,1,1,1,1,-999,-999,-999,1,1,1,-999,1,1,1/) > x at _FillValue=-999 > > There are 3 sequences of data in that 1D time series, how could I get the > first index of each sequence, so that the answer would be: > > (0) 4 > (1) 12 > (2) 16 > > Thanks > Chang > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.allured at noaa.gov Wed Feb 8 11:32:48 2023 From: dave.allured at noaa.gov (Dave Allured - NOAA Affiliate) Date: Wed, 8 Feb 2023 13:32:48 -0500 Subject: [ncl-talk] Issues with NCL and latest version of XQuartz X11? In-Reply-To: References: Message-ID: Michael, it looks like this is a known problem with the XQuartz 2.8.5 release. It is affecting other X11 software, not just NCL. The suggested workaround is to back down to 2.8.4, until the problem is resolved. Also it looks like the developers are actively working on this. https://github.com/XQuartz/XQuartz/issues/323 On Mon, Feb 6, 2023 at 5:35 PM Michael Toy - NOAA Affiliate via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hello, > > I just recently updated to XQuartz version 2.8.5 on my Mac, and since then > NCL is not able to plot to an X11 window. The plot begins to draw, but > then freezes. When I plot to a file, such as ?pdf?, the plot comes out > fine. Does anybody know if there is now an incompatibility between NCL > (v6.6.2) and XQuartz? > > Thanks, > Mike > > ? ? ? ? ? ? ? ? ? > Michael Toy, Research Scientist > CIRES, University of Colorado Boulder > NOAA Global Systems Laboratory > 325 Broadway, Boulder, Colorado > Michael.Toy at noaa.gov > +1-505-609-8782 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.toy at noaa.gov Wed Feb 8 11:35:43 2023 From: michael.toy at noaa.gov (Michael Toy - NOAA Affiliate) Date: Wed, 8 Feb 2023 11:35:43 -0700 Subject: [ncl-talk] Issues with NCL and latest version of XQuartz X11? In-Reply-To: References: Message-ID: <355862A6-0AAC-4362-9DAE-6DD1A37798BE@noaa.gov> This is good news that the issue seems to be with XQuartz, and not NCL. Thank you for pointing this out. In the meantime, I?ll revert back to 2.8.4. Best regards, Mike > On Feb 8, 2023, at 11:32 AM, Dave Allured - NOAA Affiliate wrote: > > Michael, it looks like this is a known problem with the XQuartz 2.8.5 release. It is affecting other X11 software, not just NCL. The suggested workaround is to back down to 2.8.4, until the problem is resolved. Also it looks like the developers are actively working on this. > > https://github.com/XQuartz/XQuartz/issues/323 > > > On Mon, Feb 6, 2023 at 5:35 PM Michael Toy - NOAA Affiliate via ncl-talk > wrote: > Hello, > > I just recently updated to XQuartz version 2.8.5 on my Mac, and since then NCL is not able to plot to an X11 window. The plot begins to draw, but then freezes. When I plot to a file, such as ?pdf?, the plot comes out fine. Does anybody know if there is now an incompatibility between NCL (v6.6.2) and XQuartz? > > Thanks, > Mike > > ? ? ? ? ? ? ? ? ? > Michael Toy, Research Scientist > CIRES, University of Colorado Boulder > NOAA Global Systems Laboratory > 325 Broadway, Boulder, Colorado > Michael.Toy at noaa.gov > +1-505-609-8782 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1505 bytes Desc: not available URL: From jonathan.christophersen.ctr at nrlmry.navy.mil Wed Feb 8 13:36:08 2023 From: jonathan.christophersen.ctr at nrlmry.navy.mil (Christophersen, Dr. Jonathan, Contractor, Code 7532) Date: Wed, 8 Feb 2023 20:36:08 +0000 Subject: [ncl-talk] NCL fft2df/fft2db conversion to Python Message-ID: <4c7d7a9c33c9461bab3c3194ebea94d8@ZEUS-2.nrlmry.navy.mil> Hi NCL users, Apologies if this is more of a Pythonic question than NCL, but I'm in need of some help with converting NCL's fft2df/fft2db over to Python NumPy's (or SciPy's) fft2/ifft2. I've gotten pretty close to a workable solution, but there are still some conversion problems. The Python (pseudo-)code that I've been able to reproduce NCL's fft2df function with breaks the result of the 2D-FFT into components, but this is just for investigative convenience for now :-). Code is as follows: fftData = np.fft.fft2(F_x, axes=(-2, -1), norm='forward') real_fft_tmp = np.real(fftData) imag_fft_tmp = np.imag(fftData) real_fft = 2*np.roll(np.flipud(real_fft_tmp), shift=1, axis=0) imag_fft = 2*np.roll(np.flipud(imag_fft_tmp), shift=1, axis=0) And if I'm only considering the data up to the Nyquist frequency (NCL's fft2df only returns half the spectrum) then I get a pretty close match in spectral space for both real and imaginary components. However, the differences that are present (error within 10^-5) seem to throw off the inverse FFT2 and I end up with large errors. Is anybody working on a 2D-FFT conversion from NCL to Python that might be able to answer this or shed some light on what I might be doing wrong? Thanks so much for any help, and I'm happy to answer whatever questions there might be. I'm not permitted to share my actual source code, so apologies for any inconvenience. Jon -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5477 bytes Desc: not available URL: From shea at ucar.edu Thu Feb 9 10:43:39 2023 From: shea at ucar.edu (Dennis Shea) Date: Thu, 9 Feb 2023 10:43:39 -0700 Subject: [ncl-talk] NCL fft2df/fft2db conversion to Python In-Reply-To: <4c7d7a9c33c9461bab3c3194ebea94d8@ZEUS-2.nrlmry.navy.mil> References: <4c7d7a9c33c9461bab3c3194ebea94d8@ZEUS-2.nrlmry.navy.mil> Message-ID: Perhaps the best approach: Contact NCAR's "*GeoCAT* " They should have the Python expertise to help you. Good Luck On Wed, Feb 8, 2023 at 1:36 PM Christophersen, Dr. Jonathan, Contractor, Code 7532 via ncl-talk wrote: > Hi NCL users, > > > > Apologies if this is more of a Pythonic question than NCL, but I?m in need > of some help with converting NCL?s fft2df/fft2db over to Python NumPy?s (or > SciPy?s) fft2/ifft2. I?ve gotten pretty close to a workable solution, but > there are still some conversion problems. > > > > The Python (pseudo-)code that I?ve been able to reproduce NCL?s fft2df > function with breaks the result of the 2D-FFT into components, but this is > just for investigative convenience for now :-). Code is as follows: > > > > fftData = np.fft.fft2(F_x, axes=(-2, -1), norm='forward') > > real_fft_tmp = np.real(fftData) > > imag_fft_tmp = np.imag(fftData) > > real_fft = 2*np.roll(np.flipud(real_fft_tmp), shift=1, axis=0) > > imag_fft = 2*np.roll(np.flipud(imag_fft_tmp), shift=1, axis=0) > > > > And if I?m only considering the data up to the Nyquist frequency (NCL?s > fft2df only returns half the spectrum) then I get a pretty close match in > spectral space for both real and imaginary components. However, the > differences that are present (error within 10^-5) seem to throw off the > inverse FFT2 and I end up with large errors. Is anybody working on a 2D-FFT > conversion from NCL to Python that might be able to answer this or shed > some light on what I might be doing wrong? > > > > Thanks so much for any help, and I?m happy to answer whatever questions > there might be. I?m not permitted to share my actual source code, so > apologies for any inconvenience. > > Jon > > > > > > > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Anieklal at cas.iitd.ac.in Sun Feb 12 11:30:46 2023 From: Anieklal at cas.iitd.ac.in (Anie K Lal) Date: Mon, 13 Feb 2023 00:00:46 +0530 Subject: [ncl-talk] Plot station points with markers having different colors and size with a label bar Message-ID: Hi all, I Have a csv file with lat lon and values: Lat Lon Values 27.156 77.961 16 27.883 78.067 0 25.44 81.734 39 30.383 76.767 7 31.71 74.797 47 26.681 88.329 5 27.567 81.6 7 28.422 79.451 30 24.133 88.267 0 25.233 86.95 17 23.233 87.85 0 30.733 76.883 7 26.333 89.497 3 26.167 85.9 0 24.917 84.183 0 28.585 77.206 47 25.933 80.833 0 26.3 87.267 0 24.744 84.951 46 26.74 83.45 32 27.383 80.167 0 29.179 75.755 46 26.533 88.717 3 25.491 78.558 7 26.404 80.41 0 29.7 77.033 0 22.533 88.333 7 23.4 88.517 0 25.45 82.867 25 26.867 80.933 0 26.761 80.889 46 30.867 75.933 4 27.233 79.05 0 25.033 88.133 7 29.017 77.717 7 26.667 84.917 0 26.117 85.4 0 29.617 78.383 0 22.655 88.447 47 30.333 76.467 46 25.591 85.088 47 25.267 87.467 7 26.983 84.85 0 25.3 83.017 3 I want to plot these on a map with different markers and sizes for different values ranging from 0 to 47. I followed few examples from ncl website. I need to get a plot like this https://www.ncl.ucar.edu/Applications/Images/polyg_8_lbar_lg.png I am attaching the script and plot that I got. I am not able to understand what am I doing incorrectly. Please help me solve this. Looking forward to any kind of help. Thank you Anie -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: dat_avail.ncl URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: polyg.png Type: image/png Size: 137274 bytes Desc: not available URL: From kunal.bali9 at gmail.com Sun Feb 12 13:32:44 2023 From: kunal.bali9 at gmail.com (Kunal Bali) Date: Sun, 12 Feb 2023 11:32:44 -0900 Subject: [ncl-talk] Plot station points with markers having different colors and size with a label bar In-Reply-To: References: Message-ID: Hi, For that, I think, you need to change levels = (/16,0,39,7,47,5,7,30,0,17,0,7,3,0,0,47,0,0,46,32,0,46,3,7,0,0,7,0,25,0,46,4,0,7,7,0,0,0,47,46,47,7,0,3/) to levels = (/0,5,10,15,20,25,30,35,40,45,50/) [image: polyg.png] --- Kunal Bali On Sun, 12 Feb 2023 at 09:31, Anie K Lal via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hi all, > > I Have a csv file with lat lon and values: > > Lat Lon Values > 27.156 77.961 16 > 27.883 78.067 0 > 25.44 81.734 39 > 30.383 76.767 7 > 31.71 74.797 47 > 26.681 88.329 5 > 27.567 81.6 7 > 28.422 79.451 30 > 24.133 88.267 0 > 25.233 86.95 17 > 23.233 87.85 0 > 30.733 76.883 7 > 26.333 89.497 3 > 26.167 85.9 0 > 24.917 84.183 0 > 28.585 77.206 47 > 25.933 80.833 0 > 26.3 87.267 0 > 24.744 84.951 46 > 26.74 83.45 32 > 27.383 80.167 0 > 29.179 75.755 46 > 26.533 88.717 3 > 25.491 78.558 7 > 26.404 80.41 0 > 29.7 77.033 0 > 22.533 88.333 7 > 23.4 88.517 0 > 25.45 82.867 25 > 26.867 80.933 0 > 26.761 80.889 46 > 30.867 75.933 4 > 27.233 79.05 0 > 25.033 88.133 7 > 29.017 77.717 7 > 26.667 84.917 0 > 26.117 85.4 0 > 29.617 78.383 0 > 22.655 88.447 47 > 30.333 76.467 46 > 25.591 85.088 47 > 25.267 87.467 7 > 26.983 84.85 0 > 25.3 83.017 3 > > I want to plot these on a map with different markers and sizes for > different values ranging from 0 to 47. > I followed few examples from ncl website. I need to get a plot like this > https://www.ncl.ucar.edu/Applications/Images/polyg_8_lbar_lg.png > > I am attaching the script and plot that I got. I am not able to > understand what am I doing incorrectly. Please help me solve this. > > Looking forward to any kind of help. > > Thank you > Anie_______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: polyg.png Type: image/png Size: 145541 bytes Desc: not available URL: From Anieklal at cas.iitd.ac.in Sun Feb 12 22:18:04 2023 From: Anieklal at cas.iitd.ac.in (Anie K Lal) Date: Mon, 13 Feb 2023 10:48:04 +0530 Subject: [ncl-talk] Plot station points with markers having different colors and size with a label bar In-Reply-To: References: Message-ID: <4f88df78ae651d61000eddde749d2624@cas.iitd.ac.in> I tried that, but values are not plotted against the correct stations, for example value corresponding to station (28.585,77.206) is 47 which is incorrectly shown in the plot. How to fix this? -------- Original Message -------- Subject: Re: [ncl-talk] Plot station points with markers having different colors and size with a label bar Date: 13.02.2023 02:02 From: Kunal Bali To: Anie K Lal Hi, For that, I think, you need to change levels = (/16,0,39,7,47,5,7,30,0,17,0,7,3,0,0,47,0,0,46,32,0,46,3,7,0,0,7,0,25,0,46,4,0,7,7,0,0,0,47,46,47,7,0,3/) to levels = (/0,5,10,15,20,25,30,35,40,45,50/) --- Kunal Bali On Sun, 12 Feb 2023 at 09:31, Anie K Lal via ncl-talk wrote: > Hi all, > > I Have a csv file with lat lon and values: > > Lat Lon Values > 27.156 77.961 16 > 27.883 78.067 0 > 25.44 81.734 39 > 30.383 76.767 7 > 31.71 74.797 47 > 26.681 88.329 5 > 27.567 81.6 7 > 28.422 79.451 30 > 24.133 88.267 0 > 25.233 86.95 17 > 23.233 87.85 0 > 30.733 76.883 7 > 26.333 89.497 3 > 26.167 85.9 0 > 24.917 84.183 0 > 28.585 77.206 47 > 25.933 80.833 0 > 26.3 87.267 0 > 24.744 84.951 46 > 26.74 83.45 32 > 27.383 80.167 0 > 29.179 75.755 46 > 26.533 88.717 3 > 25.491 78.558 7 > 26.404 80.41 0 > 29.7 77.033 0 > 22.533 88.333 7 > 23.4 88.517 0 > 25.45 82.867 25 > 26.867 80.933 0 > 26.761 80.889 46 > 30.867 75.933 4 > 27.233 79.05 0 > 25.033 88.133 7 > 29.017 77.717 7 > 26.667 84.917 0 > 26.117 85.4 0 > 29.617 78.383 0 > 22.655 88.447 47 > 30.333 76.467 46 > 25.591 85.088 47 > 25.267 87.467 7 > 26.983 84.85 0 > 25.3 83.017 3 > > I want to plot these on a map with different markers and sizes for > different values ranging from 0 to 47. > I followed few examples from ncl website. I need to get a plot like > this > https://www.ncl.ucar.edu/Applications/Images/polyg_8_lbar_lg.png > > I am attaching the script and plot that I got. I am not able to > understand what am I doing incorrectly. Please help me solve this. > > Looking forward to any kind of help. > > Thank you > Anie_______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk CAUTION: This email originated from outside of IIT Delhi. Do not click links or open attachments unless you recognize the sender and know the content is safe. From asphilli at ucar.edu Thu Feb 16 15:42:04 2023 From: asphilli at ucar.edu (Adam Phillips) Date: Thu, 16 Feb 2023 15:42:04 -0700 Subject: [ncl-talk] Plot station points with markers having different colors and size with a label bar In-Reply-To: <4f88df78ae651d61000eddde749d2624@cas.iitd.ac.in> References: <4f88df78ae651d61000eddde749d2624@cas.iitd.ac.in> Message-ID: Hi Anie, Kunal is correct in recommending you change your setting of levels. In the NCL example that you copied and modified, the levels array is where you put your bin values in, and the R array is where your values should go in. I have modified your script to reflect those changes, and have attached the script and resulting plot. Any further questions should be sent to the ncl-talk email list. Good luck! Adam On Sun, Feb 12, 2023 at 10:18 PM Anie K Lal via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > I tried that, but values are not plotted against the correct stations, > for example value corresponding to station (28.585,77.206) is 47 which > is incorrectly shown in the plot. > > How to fix this? > > > > > -------- Original Message -------- > Subject: Re: [ncl-talk] Plot station points with markers having > different colors and size with a label bar > Date: 13.02.2023 02:02 > From: Kunal Bali > To: Anie K Lal > > Hi, > > For that, I think, you need to change > > levels = > > (/16,0,39,7,47,5,7,30,0,17,0,7,3,0,0,47,0,0,46,32,0,46,3,7,0,0,7,0,25,0,46,4,0,7,7,0,0,0,47,46,47,7,0,3/) > > to > > levels = (/0,5,10,15,20,25,30,35,40,45,50/) > > --- > > Kunal Bali > > On Sun, 12 Feb 2023 at 09:31, Anie K Lal via ncl-talk > wrote: > > > Hi all, > > > > I Have a csv file with lat lon and values: > > > > Lat Lon Values > > 27.156 77.961 16 > > 27.883 78.067 0 > > 25.44 81.734 39 > > 30.383 76.767 7 > > 31.71 74.797 47 > > 26.681 88.329 5 > > 27.567 81.6 7 > > 28.422 79.451 30 > > 24.133 88.267 0 > > 25.233 86.95 17 > > 23.233 87.85 0 > > 30.733 76.883 7 > > 26.333 89.497 3 > > 26.167 85.9 0 > > 24.917 84.183 0 > > 28.585 77.206 47 > > 25.933 80.833 0 > > 26.3 87.267 0 > > 24.744 84.951 46 > > 26.74 83.45 32 > > 27.383 80.167 0 > > 29.179 75.755 46 > > 26.533 88.717 3 > > 25.491 78.558 7 > > 26.404 80.41 0 > > 29.7 77.033 0 > > 22.533 88.333 7 > > 23.4 88.517 0 > > 25.45 82.867 25 > > 26.867 80.933 0 > > 26.761 80.889 46 > > 30.867 75.933 4 > > 27.233 79.05 0 > > 25.033 88.133 7 > > 29.017 77.717 7 > > 26.667 84.917 0 > > 26.117 85.4 0 > > 29.617 78.383 0 > > 22.655 88.447 47 > > 30.333 76.467 46 > > 25.591 85.088 47 > > 25.267 87.467 7 > > 26.983 84.85 0 > > 25.3 83.017 3 > > > > I want to plot these on a map with different markers and sizes for > > different values ranging from 0 to 47. > > I followed few examples from ncl website. I need to get a plot like > > this > > https://www.ncl.ucar.edu/Applications/Images/polyg_8_lbar_lg.png > > > > I am attaching the script and plot that I got. I am not able to > > understand what am I doing incorrectly. Please help me solve this. > > > > Looking forward to any kind of help. > > > > Thank you > > Anie_______________________________________________ > > ncl-talk mailing list > > ncl-talk at mailman.ucar.edu > > List instructions, subscriber options, unsubscribe: > > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > > CAUTION: This email originated from outside of IIT Delhi. Do not click > links or open attachments unless you recognize the sender and know the > content is safe. > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -- Adam Phillips Associate Scientist IV, Climate Analysis Section Climate and Global Dynamics Laboratory National Center for Atmospheric Research www.cgd.ucar.edu/staff/asphilli/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dat_avail.ncl Type: application/octet-stream Size: 5893 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: polyg.png Type: image/png Size: 49870 bytes Desc: not available URL: From Anieklal at cas.iitd.ac.in Thu Feb 16 20:46:48 2023 From: Anieklal at cas.iitd.ac.in (Anie K Lal) Date: Fri, 17 Feb 2023 09:16:48 +0530 Subject: [ncl-talk] Plot station points with markers having different colors and size with a label bar In-Reply-To: References: <4f88df78ae651d61000eddde749d2624@cas.iitd.ac.in> Message-ID: <70b75aa23e8d353fcd51c38118efc91e@cas.iitd.ac.in> Hi Adam, Thanks a lot for the help. It works. -------- Original Message -------- Subject: Re: [ncl-talk] Plot station points with markers having different colors and size with a label bar Date: 17.02.2023 04:12 From: Adam Phillips To: Anie K Lal Hi Anie, Kunal is correct in recommending you change your setting of levels. In the NCL example [1] that you copied and modified, the levels array is where you put your bin values in, and the R array is where your values should go in. I have modified your script to reflect those changes, and have attached the script and resulting plot. Any further questions should be sent to the ncl-talk email list. Good luck! Adam On Sun, Feb 12, 2023 at 10:18 PM Anie K Lal via ncl-talk wrote: > I tried that, but values are not plotted against the correct > stations, > for example value corresponding to station (28.585,77.206) is 47 > which > is incorrectly shown in the plot. > > How to fix this? > > -------- Original Message -------- > Subject: Re: [ncl-talk] Plot station points with markers having > different colors and size with a label bar > Date: 13.02.2023 02:02 > From: Kunal Bali > To: Anie K Lal > > Hi, > > For that, I think, you need to change > > levels = > (/16,0,39,7,47,5,7,30,0,17,0,7,3,0,0,47,0,0,46,32,0,46,3,7,0,0,7,0,25,0,46,4,0,7,7,0,0,0,47,46,47,7,0,3/) > > to > > levels = (/0,5,10,15,20,25,30,35,40,45,50/) > > --- > > Kunal Bali > > On Sun, 12 Feb 2023 at 09:31, Anie K Lal via ncl-talk > wrote: > >> Hi all, >> >> I Have a csv file with lat lon and values: >> >> Lat Lon Values >> 27.156 77.961 16 >> 27.883 78.067 0 >> 25.44 81.734 39 >> 30.383 76.767 7 >> 31.71 74.797 47 >> 26.681 88.329 5 >> 27.567 81.6 7 >> 28.422 79.451 30 >> 24.133 88.267 0 >> 25.233 86.95 17 >> 23.233 87.85 0 >> 30.733 76.883 7 >> 26.333 89.497 3 >> 26.167 85.9 0 >> 24.917 84.183 0 >> 28.585 77.206 47 >> 25.933 80.833 0 >> 26.3 87.267 0 >> 24.744 84.951 46 >> 26.74 83.45 32 >> 27.383 80.167 0 >> 29.179 75.755 46 >> 26.533 88.717 3 >> 25.491 78.558 7 >> 26.404 80.41 0 >> 29.7 77.033 0 >> 22.533 88.333 7 >> 23.4 88.517 0 >> 25.45 82.867 25 >> 26.867 80.933 0 >> 26.761 80.889 46 >> 30.867 75.933 4 >> 27.233 79.05 0 >> 25.033 88.133 7 >> 29.017 77.717 7 >> 26.667 84.917 0 >> 26.117 85.4 0 >> 29.617 78.383 0 >> 22.655 88.447 47 >> 30.333 76.467 46 >> 25.591 85.088 47 >> 25.267 87.467 7 >> 26.983 84.85 0 >> 25.3 83.017 3 >> >> I want to plot these on a map with different markers and sizes for >> different values ranging from 0 to 47. >> I followed few examples from ncl website. I need to get a plot > like >> this >> https://www.ncl.ucar.edu/Applications/Images/polyg_8_lbar_lg.png >> >> I am attaching the script and plot that I got. I am not able to >> understand what am I doing incorrectly. Please help me solve this. >> >> Looking forward to any kind of help. >> >> Thank you >> Anie_______________________________________________ >> ncl-talk mailing list >> ncl-talk at mailman.ucar.edu >> List instructions, subscriber options, unsubscribe: >> https://mailman.ucar.edu/mailman/listinfo/ncl-talk > > CAUTION: This email originated from outside of IIT Delhi. Do not > click > links or open attachments unless you recognize the sender and know > the > content is safe. > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk -- Adam Phillips Associate Scientist IV, Climate Analysis Section Climate and Global Dynamics Laboratory National Center for Atmospheric Research www.cgd.ucar.edu/staff/asphilli/ [2] [3] CAUTION: This email originated from outside of IIT Delhi. Do not click links or open attachments unless you recognize the sender and know the content is safe. Links: ------ [1] https://www.ncl.ucar.edu/Applications/Scripts/polyg_8_lbar.ncl [2] http://www.cgd.ucar.edu/staff/asphilli/ [3] http://www.cgd.ucar.edu/staff/asphilli From lesley.l.smith at noaa.gov Wed Feb 22 11:42:47 2023 From: lesley.l.smith at noaa.gov (Lesley Smith - NOAA Affiliate) Date: Wed, 22 Feb 2023 11:42:47 -0700 Subject: [ncl-talk] vorticity: absolute or relative? Message-ID: Greetings awesome NCL community! Does anyone know if the vorticity functions uv2vrdvF, uv2vrG and similar compute absolute vorticity or relative vorticity? Only the uv2vr_cfd documentation specifies "relative vorticity." The others say "vorticity." Thanks for any input! -Lesley Lesley L. Smith, Ph.D. CIRES & NOAA PSL From brownrig at ucar.edu Wed Feb 22 12:34:06 2023 From: brownrig at ucar.edu (Rick Brownrigg) Date: Wed, 22 Feb 2023 12:34:06 -0700 Subject: [ncl-talk] vorticity: absolute or relative? In-Reply-To: References: Message-ID: This is NOT a definitive answer, rather some insights gleaned by looking at the source code. The code that does the numerical computation behind uv2vr_cfd specifically mentions relative vorticity. As far as I can tell, the rest of those similarly named functions use NCAR's spherepack library under the hood to perform their numerical processing. I don't have the expertise to look at those calculations and tell you absolute vs relative. Nowhere in the spherepack source code does the word "relative" appear. So that's also NOT much of an answer -- my apologies. A naive question: is it possible to contrive some data and run it through those other routines, which would reveal relative vs absolute. Rick On Wed, Feb 22, 2023 at 11:43 AM Lesley Smith - NOAA Affiliate via ncl-talk wrote: > Greetings awesome NCL community! > Does anyone know if the vorticity functions uv2vrdvF, uv2vrG and > similar compute absolute vorticity or relative vorticity? > Only the uv2vr_cfd documentation specifies "relative vorticity." > The others say "vorticity." > Thanks for any input! > -Lesley > > Lesley L. Smith, Ph.D. > CIRES & NOAA PSL > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shea at ucar.edu Wed Feb 22 14:41:12 2023 From: shea at ucar.edu (Dennis Shea) Date: Wed, 22 Feb 2023 14:41:12 -0700 Subject: [ncl-talk] vorticity: absolute or relative? In-Reply-To: References: Message-ID: "relative" The Coriolis parameter is not included. On Wed, Feb 22, 2023 at 12:34 PM Rick Brownrigg via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > This is NOT a definitive answer, rather some insights gleaned by looking > at the source code. The code that does the numerical computation behind > uv2vr_cfd specifically mentions relative vorticity. As far as I can tell, > the rest of those similarly named functions use NCAR's spherepack library > under the hood to perform their numerical processing. I don't have the > expertise to look at those calculations and tell you absolute vs relative. > Nowhere in the spherepack source code does the word "relative" appear. > > So that's also NOT much of an answer -- my apologies. A naive question: is > it possible to contrive some data and run it through those other routines, > which would reveal relative vs absolute. > > Rick > > > On Wed, Feb 22, 2023 at 11:43 AM Lesley Smith - NOAA Affiliate via > ncl-talk wrote: > >> Greetings awesome NCL community! >> Does anyone know if the vorticity functions uv2vrdvF, uv2vrG and >> similar compute absolute vorticity or relative vorticity? >> Only the uv2vr_cfd documentation specifies "relative vorticity." >> The others say "vorticity." >> Thanks for any input! >> -Lesley >> >> Lesley L. Smith, Ph.D. >> CIRES & NOAA PSL >> _______________________________________________ >> ncl-talk mailing list >> ncl-talk at mailman.ucar.edu >> List instructions, subscriber options, unsubscribe: >> https://mailman.ucar.edu/mailman/listinfo/ncl-talk >> > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.Lazenby at sussex.ac.uk Fri Feb 24 06:10:57 2023 From: M.Lazenby at sussex.ac.uk (Melissa Lazenby) Date: Fri, 24 Feb 2023 13:10:57 +0000 Subject: [ncl-talk] If statement Message-ID: Hi All NCL Users I am struggling with a conditional statement that I would like to perform. Essentially, I am trying to make some bars pink instead of red to show a difference in uncertainty. I have the following code below to perform this but I think there is an error with how I am looping the array. do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) if ((hh.eq.1) .or. (hh.eq.2) .or. (hh.eq.3)) then sres at gsnXYBarChartColors = (/"pink"/) else sres at gsnXYBarChartColors = (/"red"/) end if plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(hh,0),sres) ; draw each time series end do This error occurs: (0) gsn_csm_xy: Fatal: X and Y must have the same dimensions sizes, or one must be one-dimensional and both have the same rightmost dimension. Any help on this would be much appreciated! Many thanks! Kindest Regards Melissa Full Code: ;******************************************************* ; Mpwapwa.ncl ; ; Concepts illustrated: ; - Drawing multiple bar charts on a page ; - Drawing three custom legends outside a bar chart ; - Using bar charts to draw standard deviations for four time series ; - Drawing a time series plot ;******************************************************* ; ; These files are loaded by default in NCL V6.2.0 and newer load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin x = (/1856,?1857,?1858,?1859,?1860,?1861,?1862,?1863,?1864,?1865,?1866,?1867,?1868,?1869,?1870,?1871,?1872,?1873,?1874,?1875,?1876,?1877,?1878,?1879,?1880,?1881,?1882,?1883,?1884,?1885,?1886,?1887,?1888,?1889/) yIndex = (/0,2,-1,-3,2,0,0,0,0,0,0,0,0,0,0,0.05,2,0,-1,-1,-2,1,1,-2,-2,1,-1,-3,0.05,0.05,0.05,-3,0.05,0/) y20CR3 = (/-1.7049024,??-1.9956352,?0.1017878,??1.5787968,??0.2902762,??0.1615032,??0.7573914,??0.127654184,??????0.3391526,??0.18975348,?1.4533978,??0.28738338,?0.8228474,??-1.2142216,?0.67589808,?1.3983746,??1.1087944,??0.58095216,?-1.3422622,?0.226781852,??????2.173188,???0.6511904,??0.9723054,??-0.4989326,?-1.5402072,?-0.1535788,?-0.226605,??-1.6808838,?-0.19809544,??????-0.1772666,?0.0769234,??-0.6346154,?-1.2222682,?-0.0073483/) ;scaled by 5 and deleted first value to go for year 2. yCMIP5 = (/-0.9094243, 0.5458735, -0.8682191, -1.826278, -0.6501346, 0.1305088, 0.51643, 0.6247665, -0.4082086, 0.3641764, 1.476322, 0.842743, -0.5013026, -0.1281874, 0.4829363, -0.7015711, 0.269588, -0.2834916, -0.8827865, -0.4242322, -1.171241, -0.8289737, -0.4638377, 0.8812776, 0.5154026, -1.191759 ,0.8223722, -1.198702, -0.8878552, -1.724694, -1.62958, 1.02131, -1.440305, -2.299565/) stdarr = new((/34,3/),"float") do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) stdarr(hh,1) = (/ (y20CR3(hh::34)) /) stdarr(hh,2) = (/ (yCMIP5(hh::34)) /) end do print("Index Data = "+dimsizes(yIndex)+", 20CR3 = "+dimsizes(y20CR3)+", CMIP5 = "+dimsizes(yCMIP5)) printVarSummary(stdarr) ;======================================================================================??? wks = gsn_open_wks("X11","Mpwapwa_3_Plot") ; send graphics to PNG file sres = True sres at trXMinF = 1855 sres at trXMaxF = 1890 sres at tmXBValues = ispan(1855,1890,5) ; create major tickmarks with labels every 5 years sres at tmXBLabels = sres at tmXBValues sres at tmXBMinorValues = ispan(1855,1890,1) ; as tmXBMode = "Explicit", this resource needs to be set to get minor tickmarks. Create minor tickmarks every year. sres at vpWidthF = 0.8 sres at vpHeightF = 0.5 sres at vpXF = .15 sres at trYMinF = -3.5 sres at trYMaxF = 3.5 sres at gsnDraw = True ;sres at gsnFrame = False sres at gsnXYBarChart = True sres at gsnXYBarChartBarWidth = 0.20 ; change bar widths sres at tmXBMode = "Explicit" ; explicit labels sres at tmXBLabelFontHeightF = 0.0205 sres at tmXTLabelFontHeightF = 0.0205 sres at tmYLLabelFontHeightF = 0.0225 sres at tiMainFontHeightF = 0.025 sres at tiMainFont = "helvetica" sres at tiMainString = "Precipitation Anomalies for Mpwapwa" sres at gsnRightString = "" sres at tiYAxisString = "Pr Anomalies (mm/day) DJFMA" sres at gsnYRefLine = 0. ; reference line do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) if ((hh.eq.1) .or. (hh.eq.2) .or. (hh.eq.3)) then sres at gsnXYBarChartColors = (/"pink"/) else sres at gsnXYBarChartColors = (/"red"/) end if plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(hh,0),sres) ; draw each time series end do sres at gsnXYBarChartColors = (/"black"/) ; seperately, not plot2 = gsn_csm_xy(wks,fspan(1855.8,1888.9,34),stdarr(:,1),sres) ; advancing the frame sres at gsnXYBarChartColors = (/"blue"/) ; drawn on the X-axis plot3 = gsn_csm_xy(wks,fspan(1856.4,1889.2,34),stdarr(:,2),sres) lbres = True ; labelbar only resources lbres at vpWidthF = 0.2 ; labelbar width lbres at vpHeightF = 0.1 ; labelbar height lbres at lbBoxMajorExtentF = 0.56 ; puts space between color boxes lbres at lbMonoFillPattern = True ; Solid fill pattern lbres at lbLabelFontHeightF = 0.025 ; font height. default is small lbres at lbLabelJust = "CenterLeft" ; left justify labels lbres at lbPerimOn = False lbres at lgPerimColor ?????? = "white" colors = (/"red", "black", "blue"/) labels = (/"Index", "Reanalysis", "CMIP5"/) xpos = (/0.15, 0.40, 0.7/) do i=0,2 lbres at lbFillColors = colors(i) gsn_labelbar_ndc(wks,1,labels(i),xpos(i),0.20,lbres) end do frame(wks) end Dr. Melissa Lazenby Lecturer in Climate Change Department of Geography Chichester 1 C150 University of Sussex "Education is the most powerful weapon which you can use to change the world" Nelson Mandela [cid:a164c079-9320-46e5-877d-0852711e5ddb] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Outlook-wdomdmsr.png Type: image/png Size: 24937 bytes Desc: Outlook-wdomdmsr.png URL: From shea at ucar.edu Fri Feb 24 07:50:45 2023 From: shea at ucar.edu (Dennis Shea) Date: Fri, 24 Feb 2023 07:50:45 -0700 Subject: [ncl-talk] If statement In-Reply-To: References: Message-ID: I have not looked at the script but: --- do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) --- hh is a scalar. So, when (say) hh=0 stdarr(0,0) = (/ (yIndex(0::34)) /) ; ==> 35 elements of yIndex 35 elements are being assigned to one array element. NCL should have issued an error message. Maybe, I am missing something! On Fri, Feb 24, 2023 at 6:11 AM Melissa Lazenby via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hi All NCL Users > > I am struggling with a conditional statement that I would like to perform. > Essentially, I am trying to make some bars pink instead of red to show a > difference in uncertainty. > I have the following code below to perform this but I think there is an > error with how I am looping the array. > > do hh = 0,33 > stdarr(hh,0) = (/ (yIndex(hh::34)) /) > > if ((hh.eq.1) .or. (hh.eq.2) .or. (hh.eq.3)) then > sres at gsnXYBarChartColors = (/"pink"/) > else > sres at gsnXYBarChartColors = (/"red"/) > end if > plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(hh,0),sres) > ; draw each time series > > end do > > This error occurs: > (0) gsn_csm_xy: Fatal: X and Y must have the same dimensions sizes, or > one must be one-dimensional and both have the same rightmost dimension. > > > Any help on this would be much appreciated! > > Many thanks! > > Kindest Regards > Melissa > > Full Code: > > ;******************************************************* > ; Mpwapwa.ncl > ; > ; Concepts illustrated: > ; - Drawing multiple bar charts on a page > ; - Drawing three custom legends outside a bar chart > ; - Using bar charts to draw standard deviations for four time series > ; - Drawing a time series plot > ;******************************************************* > ; > ; These files are loaded by default in NCL V6.2.0 and newer > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" > > begin > > > x = (/1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, > 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, > 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889/) > > yIndex = > (/0,2,-1,-3,2,0,0,0,0,0,0,0,0,0,0,0.05,2,0,-1,-1,-2,1,1,-2,-2,1,-1,-3,0.05,0.05,0.05,-3,0.05,0/) > > > y20CR3 = (/-1.7049024, -1.9956352, 0.1017878, 1.5787968, 0.2902762, > 0.1615032, 0.7573914, 0.127654184, 0.3391526, 0.18975348, 1.4533978, > 0.28738338, 0.8228474, -1.2142216, 0.67589808, 1.3983746, 1.1087944, > 0.58095216, -1.3422622, 0.226781852, 2.173188, 0.6511904, 0.9723054, > -0.4989326, -1.5402072, -0.1535788, -0.226605, -1.6808838, -0.19809544, > -0.1772666, 0.0769234, -0.6346154, -1.2222682, -0.0073483/) > > ;scaled by 5 and deleted first value to go for year 2. > yCMIP5 = (/-0.9094243, 0.5458735, -0.8682191, -1.826278, -0.6501346, > 0.1305088, 0.51643, 0.6247665, -0.4082086, 0.3641764, 1.476322, 0.842743, > -0.5013026, -0.1281874, 0.4829363, -0.7015711, 0.269588, -0.2834916, > -0.8827865, -0.4242322, -1.171241, -0.8289737, -0.4638377, 0.8812776, > 0.5154026, -1.191759 ,0.8223722, -1.198702, -0.8878552, -1.724694, > -1.62958, 1.02131, -1.440305, -2.299565/) > > > stdarr = new((/34,3/),"float") > do hh = 0,33 > stdarr(hh,0) = (/ (yIndex(hh::34)) /) > stdarr(hh,1) = (/ (y20CR3(hh::34)) /) > stdarr(hh,2) = (/ (yCMIP5(hh::34)) /) > end do > print("Index Data = "+dimsizes(yIndex)+", 20CR3 = > "+dimsizes(y20CR3)+", CMIP5 = "+dimsizes(yCMIP5)) > > printVarSummary(stdarr) > > ;====================================================================================== > > wks = gsn_open_wks("X11","Mpwapwa_3_Plot") ; send graphics > to PNG file > > > sres = True > > sres at trXMinF = 1855 > sres at trXMaxF = 1890 > sres at tmXBValues = ispan(1855,1890,5) ; create major tickmarks with > labels every 5 years > sres at tmXBLabels = sres at tmXBValues > sres at tmXBMinorValues = ispan(1855,1890,1) ; as tmXBMode = "Explicit", > this resource needs to be set to get minor tickmarks. Create minor > tickmarks every year. > > sres at vpWidthF = 0.8 > sres at vpHeightF = 0.5 > sres at vpXF = .15 > sres at trYMinF = -3.5 > sres at trYMaxF = 3.5 > sres at gsnDraw = True > ;sres at gsnFrame = False > sres at gsnXYBarChart = True > sres at gsnXYBarChartBarWidth = 0.20 ; change bar widths > sres at tmXBMode = "Explicit" ; explicit labels > sres at tmXBLabelFontHeightF = 0.0205 > sres at tmXTLabelFontHeightF = 0.0205 > sres at tmYLLabelFontHeightF = 0.0225 > sres at tiMainFontHeightF = 0.025 > sres at tiMainFont = "helvetica" > sres at tiMainString = "Precipitation Anomalies for Mpwapwa" > sres at gsnRightString = "" > sres at tiYAxisString = "Pr Anomalies (mm/day) DJFMA" > sres at gsnYRefLine = 0. ; reference line > > do hh = 0,33 > stdarr(hh,0) = (/ (yIndex(hh::34)) /) > > if ((hh.eq.1) .or. (hh.eq.2) .or. (hh.eq.3)) then > sres at gsnXYBarChartColors = (/"pink"/) > else > sres at gsnXYBarChartColors = (/"red"/) > end if > plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(hh,0),sres) > ; draw each time series > > end do > > > sres at gsnXYBarChartColors = (/"black"/) ; > seperately, not > plot2 = gsn_csm_xy(wks,fspan(1855.8,1888.9,34),stdarr(:,1),sres) > ; advancing the frame > sres at gsnXYBarChartColors = (/"blue"/) ; > drawn on the X-axis > plot3 = gsn_csm_xy(wks,fspan(1856.4,1889.2,34),stdarr(:,2),sres) > > lbres = True ; labelbar only resources > lbres at vpWidthF = 0.2 ; labelbar width > lbres at vpHeightF = 0.1 ; labelbar height > lbres at lbBoxMajorExtentF = 0.56 ; puts space between color > boxes > lbres at lbMonoFillPattern = True ; Solid fill pattern > lbres at lbLabelFontHeightF = 0.025 ; font height. default is > small > lbres at lbLabelJust = "CenterLeft" ; left justify labels > lbres at lbPerimOn = False > lbres at lgPerimColor = "white" > colors = (/"red", "black", "blue"/) > labels = (/"Index", "Reanalysis", "CMIP5"/) > xpos = (/0.15, 0.40, 0.7/) > > do i=0,2 > lbres at lbFillColors = colors(i) > gsn_labelbar_ndc(wks,1,labels(i),xpos(i),0.20,lbres) > end do > > frame(wks) > end > > > Dr. Melissa Lazenby > Lecturer in Climate Change > Department of Geography > Chichester 1 C150 > University of Sussex > > *"Education is the most powerful weapon which you can use to change the > world" Nelson Mandela* > > > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Outlook-wdomdmsr.png Type: image/png Size: 24937 bytes Desc: not available URL: From M.Lazenby at sussex.ac.uk Fri Feb 24 10:04:49 2023 From: M.Lazenby at sussex.ac.uk (Melissa Lazenby) Date: Fri, 24 Feb 2023 17:04:49 +0000 Subject: [ncl-talk] If statement In-Reply-To: References: Message-ID: Hi Dennis Many thanks for your speedy response. I have gotten confused in which variable I am trying to set. What I actually want to do is select years which appear in the x axis differently based on their certainty. For example I want to make the year 1858 show up as a pink bar instead of a red bar to show less certainty. Therefore I will need to make an if statement to reflect that for the x axis - however I have used the function fspan in my x value expression so not sure how to do this. Would this maybe work? if ((fspan.eq.1857) .or. (fspan.eq.1858) .or. (fspan.eq.1859)) then sres at gsnXYBarChartColors = (/"pink"/) else sres at gsnXYBarChartColors = (/"red"/) end if plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(:,0),sres) Many thanks for all your help! Kindest Regards Melissa Dr. Melissa Lazenby Lecturer in Climate Change Department of Geography Chichester 1 C150 University of Sussex "Education is the most powerful weapon which you can use to change the world" Nelson Mandela [cid:47c2037d-44fd-4b28-9471-95f285cfbc2c] ________________________________ From: Dennis Shea Sent: Friday, February 24, 2023 2:50 PM To: Melissa Lazenby Cc: Ncl-talk Subject: Re: [ncl-talk] If statement I have not looked at the script but: --- do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) --- hh is a scalar. So, when (say) hh=0 stdarr(0,0) = (/ (yIndex(0::34)) /) ; ==> 35 elements of yIndex 35 elements are being assigned to one array element. NCL should have issued an error message. Maybe, I am missing something! On Fri, Feb 24, 2023 at 6:11 AM Melissa Lazenby via ncl-talk > wrote: Hi All NCL Users I am struggling with a conditional statement that I would like to perform. Essentially, I am trying to make some bars pink instead of red to show a difference in uncertainty. I have the following code below to perform this but I think there is an error with how I am looping the array. do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) if ((hh.eq.1) .or. (hh.eq.2) .or. (hh.eq.3)) then sres at gsnXYBarChartColors = (/"pink"/) else sres at gsnXYBarChartColors = (/"red"/) end if plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(hh,0),sres) ; draw each time series end do This error occurs: (0) gsn_csm_xy: Fatal: X and Y must have the same dimensions sizes, or one must be one-dimensional and both have the same rightmost dimension. Any help on this would be much appreciated! Many thanks! Kindest Regards Melissa Full Code: ;******************************************************* ; Mpwapwa.ncl ; ; Concepts illustrated: ; - Drawing multiple bar charts on a page ; - Drawing three custom legends outside a bar chart ; - Using bar charts to draw standard deviations for four time series ; - Drawing a time series plot ;******************************************************* ; ; These files are loaded by default in NCL V6.2.0 and newer load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin x = (/1856,?1857,?1858,?1859,?1860,?1861,?1862,?1863,?1864,?1865,?1866,?1867,?1868,?1869,?1870,?1871,?1872,?1873,?1874,?1875,?1876,?1877,?1878,?1879,?1880,?1881,?1882,?1883,?1884,?1885,?1886,?1887,?1888,?1889/) yIndex = (/0,2,-1,-3,2,0,0,0,0,0,0,0,0,0,0,0.05,2,0,-1,-1,-2,1,1,-2,-2,1,-1,-3,0.05,0.05,0.05,-3,0.05,0/) y20CR3 = (/-1.7049024,??-1.9956352,?0.1017878,??1.5787968,??0.2902762,??0.1615032,??0.7573914,??0.127654184,??????0.3391526,??0.18975348,?1.4533978,??0.28738338,?0.8228474,??-1.2142216,?0.67589808,?1.3983746,??1.1087944,??0.58095216,?-1.3422622,?0.226781852,??????2.173188,???0.6511904,??0.9723054,??-0.4989326,?-1.5402072,?-0.1535788,?-0.226605,??-1.6808838,?-0.19809544,??????-0.1772666,?0.0769234,??-0.6346154,?-1.2222682,?-0.0073483/) ;scaled by 5 and deleted first value to go for year 2. yCMIP5 = (/-0.9094243, 0.5458735, -0.8682191, -1.826278, -0.6501346, 0.1305088, 0.51643, 0.6247665, -0.4082086, 0.3641764, 1.476322, 0.842743, -0.5013026, -0.1281874, 0.4829363, -0.7015711, 0.269588, -0.2834916, -0.8827865, -0.4242322, -1.171241, -0.8289737, -0.4638377, 0.8812776, 0.5154026, -1.191759 ,0.8223722, -1.198702, -0.8878552, -1.724694, -1.62958, 1.02131, -1.440305, -2.299565/) stdarr = new((/34,3/),"float") do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) stdarr(hh,1) = (/ (y20CR3(hh::34)) /) stdarr(hh,2) = (/ (yCMIP5(hh::34)) /) end do print("Index Data = "+dimsizes(yIndex)+", 20CR3 = "+dimsizes(y20CR3)+", CMIP5 = "+dimsizes(yCMIP5)) printVarSummary(stdarr) ;======================================================================================??? wks = gsn_open_wks("X11","Mpwapwa_3_Plot") ; send graphics to PNG file sres = True sres at trXMinF = 1855 sres at trXMaxF = 1890 sres at tmXBValues = ispan(1855,1890,5) ; create major tickmarks with labels every 5 years sres at tmXBLabels = sres at tmXBValues sres at tmXBMinorValues = ispan(1855,1890,1) ; as tmXBMode = "Explicit", this resource needs to be set to get minor tickmarks. Create minor tickmarks every year. sres at vpWidthF = 0.8 sres at vpHeightF = 0.5 sres at vpXF = .15 sres at trYMinF = -3.5 sres at trYMaxF = 3.5 sres at gsnDraw = True ;sres at gsnFrame = False sres at gsnXYBarChart = True sres at gsnXYBarChartBarWidth = 0.20 ; change bar widths sres at tmXBMode = "Explicit" ; explicit labels sres at tmXBLabelFontHeightF = 0.0205 sres at tmXTLabelFontHeightF = 0.0205 sres at tmYLLabelFontHeightF = 0.0225 sres at tiMainFontHeightF = 0.025 sres at tiMainFont = "helvetica" sres at tiMainString = "Precipitation Anomalies for Mpwapwa" sres at gsnRightString = "" sres at tiYAxisString = "Pr Anomalies (mm/day) DJFMA" sres at gsnYRefLine = 0. ; reference line do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) if ((hh.eq.1) .or. (hh.eq.2) .or. (hh.eq.3)) then sres at gsnXYBarChartColors = (/"pink"/) else sres at gsnXYBarChartColors = (/"red"/) end if plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(hh,0),sres) ; draw each time series end do sres at gsnXYBarChartColors = (/"black"/) ; seperately, not plot2 = gsn_csm_xy(wks,fspan(1855.8,1888.9,34),stdarr(:,1),sres) ; advancing the frame sres at gsnXYBarChartColors = (/"blue"/) ; drawn on the X-axis plot3 = gsn_csm_xy(wks,fspan(1856.4,1889.2,34),stdarr(:,2),sres) lbres = True ; labelbar only resources lbres at vpWidthF = 0.2 ; labelbar width lbres at vpHeightF = 0.1 ; labelbar height lbres at lbBoxMajorExtentF = 0.56 ; puts space between color boxes lbres at lbMonoFillPattern = True ; Solid fill pattern lbres at lbLabelFontHeightF = 0.025 ; font height. default is small lbres at lbLabelJust = "CenterLeft" ; left justify labels lbres at lbPerimOn = False lbres at lgPerimColor ?????? = "white" colors = (/"red", "black", "blue"/) labels = (/"Index", "Reanalysis", "CMIP5"/) xpos = (/0.15, 0.40, 0.7/) do i=0,2 lbres at lbFillColors = colors(i) gsn_labelbar_ndc(wks,1,labels(i),xpos(i),0.20,lbres) end do frame(wks) end Dr. Melissa Lazenby Lecturer in Climate Change Department of Geography Chichester 1 C150 University of Sussex "Education is the most powerful weapon which you can use to change the world" Nelson Mandela [cid:18683e33db65b2dc94e1] _______________________________________________ ncl-talk mailing list ncl-talk at mailman.ucar.edu List instructions, subscriber options, unsubscribe: https://mailman.ucar.edu/mailman/listinfo/ncl-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Outlook-wdomdmsr.png Type: image/png Size: 24937 bytes Desc: Outlook-wdomdmsr.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Outlook-nxmphdna.png Type: image/png Size: 24937 bytes Desc: Outlook-nxmphdna.png URL: From asphilli at ucar.edu Sat Feb 25 08:48:04 2023 From: asphilli at ucar.edu (Adam Phillips) Date: Sat, 25 Feb 2023 08:48:04 -0700 Subject: [ncl-talk] If statement In-Reply-To: References: Message-ID: Hi Melissa, I would create an array of strings pertaining to the individual bar colors, like this: bc = new(34,string) bc = "red" time = ispan(1855,1888,1) selyr = (/1857,1858,1859/) do gg = 0,dimsizes(selyr)-1 bc = where(time.eq.selyr(gg),"pink",bc) end do print(time+" "+bc) and then you can tell NCL to color each bar by the bc array: res at gsnXYBarChartColors2 = bc plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(:,0),sres) See the 2nd panel of example #6 here: https://www.ncl.ucar.edu/Applications/bar.shtml#ex6 Hope that helps! Adam On Fri, Feb 24, 2023 at 10:04 AM Melissa Lazenby via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hi Dennis > > Many thanks for your speedy response. > I have gotten confused in which variable I am trying to set. > What I actually want to do is select years which appear in the x axis > differently based on their certainty. > For example I want to make the year 1858 show up as a pink bar instead of > a red bar to show less certainty. > Therefore I will need to make an if statement to reflect that for the x > axis - however I have used the function fspan in my x value expression so > not sure how to do this. > > Would this maybe work? > if ((fspan.eq.1857) .or. (fspan.eq.1858) .or. (fspan.eq.1859)) then > sres at gsnXYBarChartColors = (/"pink"/) > else > sres at gsnXYBarChartColors = (/"red"/) > end if > plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(:,0),sres) > > > Many thanks for all your help! > > Kindest Regards > Melissa > > Dr. Melissa Lazenby > Lecturer in Climate Change > Department of Geography > Chichester 1 C150 > University of Sussex > > *"Education is the most powerful weapon which you can use to change the > world" Nelson Mandela* > > > ------------------------------ > *From:* Dennis Shea > *Sent:* Friday, February 24, 2023 2:50 PM > *To:* Melissa Lazenby > *Cc:* Ncl-talk > *Subject:* Re: [ncl-talk] If statement > > I have not looked at the script but: > --- > do hh = 0,33 > stdarr(hh,0) = (/ (yIndex(hh::34)) /) > --- > > hh is a scalar. So, when (say) hh=0 > > stdarr(0,0) = (/ (yIndex(0::34)) /) ; ==> 35 elements of yIndex > > 35 elements are being assigned to one array element. > > NCL should have issued an error message. > > Maybe, I am missing something! > > > > > > > On Fri, Feb 24, 2023 at 6:11 AM Melissa Lazenby via ncl-talk < > ncl-talk at mailman.ucar.edu> wrote: > > Hi All NCL Users > > I am struggling with a conditional statement that I would like to perform. > Essentially, I am trying to make some bars pink instead of red to show a > difference in uncertainty. > I have the following code below to perform this but I think there is an > error with how I am looping the array. > > do hh = 0,33 > stdarr(hh,0) = (/ (yIndex(hh::34)) /) > > if ((hh.eq.1) .or. (hh.eq.2) .or. (hh.eq.3)) then > sres at gsnXYBarChartColors = (/"pink"/) > else > sres at gsnXYBarChartColors = (/"red"/) > end if > plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(hh,0),sres) > ; draw each time series > > end do > > This error occurs: > (0) gsn_csm_xy: Fatal: X and Y must have the same dimensions sizes, or > one must be one-dimensional and both have the same rightmost dimension. > > > Any help on this would be much appreciated! > > Many thanks! > > Kindest Regards > Melissa > > Full Code: > > ;******************************************************* > ; Mpwapwa.ncl > ; > ; Concepts illustrated: > ; - Drawing multiple bar charts on a page > ; - Drawing three custom legends outside a bar chart > ; - Using bar charts to draw standard deviations for four time series > ; - Drawing a time series plot > ;******************************************************* > ; > ; These files are loaded by default in NCL V6.2.0 and newer > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" > > begin > > > x = (/1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, > 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, > 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889/) > > yIndex = > (/0,2,-1,-3,2,0,0,0,0,0,0,0,0,0,0,0.05,2,0,-1,-1,-2,1,1,-2,-2,1,-1,-3,0.05,0.05,0.05,-3,0.05,0/) > > > y20CR3 = (/-1.7049024, -1.9956352, 0.1017878, 1.5787968, 0.2902762, > 0.1615032, 0.7573914, 0.127654184, 0.3391526, 0.18975348, 1.4533978, > 0.28738338, 0.8228474, -1.2142216, 0.67589808, 1.3983746, 1.1087944, > 0.58095216, -1.3422622, 0.226781852, 2.173188, 0.6511904, 0.9723054, > -0.4989326, -1.5402072, -0.1535788, -0.226605, -1.6808838, -0.19809544, > -0.1772666, 0.0769234, -0.6346154, -1.2222682, -0.0073483/) > > ;scaled by 5 and deleted first value to go for year 2. > yCMIP5 = (/-0.9094243, 0.5458735, -0.8682191, -1.826278, -0.6501346, > 0.1305088, 0.51643, 0.6247665, -0.4082086, 0.3641764, 1.476322, 0.842743, > -0.5013026, -0.1281874, 0.4829363, -0.7015711, 0.269588, -0.2834916, > -0.8827865, -0.4242322, -1.171241, -0.8289737, -0.4638377, 0.8812776, > 0.5154026, -1.191759 ,0.8223722, -1.198702, -0.8878552, -1.724694, > -1.62958, 1.02131, -1.440305, -2.299565/) > > > stdarr = new((/34,3/),"float") > do hh = 0,33 > stdarr(hh,0) = (/ (yIndex(hh::34)) /) > stdarr(hh,1) = (/ (y20CR3(hh::34)) /) > stdarr(hh,2) = (/ (yCMIP5(hh::34)) /) > end do > print("Index Data = "+dimsizes(yIndex)+", 20CR3 = > "+dimsizes(y20CR3)+", CMIP5 = "+dimsizes(yCMIP5)) > > printVarSummary(stdarr) > > ;====================================================================================== > > wks = gsn_open_wks("X11","Mpwapwa_3_Plot") ; send graphics > to PNG file > > > sres = True > > sres at trXMinF = 1855 > sres at trXMaxF = 1890 > sres at tmXBValues = ispan(1855,1890,5) ; create major tickmarks with > labels every 5 years > sres at tmXBLabels = sres at tmXBValues > sres at tmXBMinorValues = ispan(1855,1890,1) ; as tmXBMode = "Explicit", > this resource needs to be set to get minor tickmarks. Create minor > tickmarks every year. > > sres at vpWidthF = 0.8 > sres at vpHeightF = 0.5 > sres at vpXF = .15 > sres at trYMinF = -3.5 > sres at trYMaxF = 3.5 > sres at gsnDraw = True > ;sres at gsnFrame = False > sres at gsnXYBarChart = True > sres at gsnXYBarChartBarWidth = 0.20 ; change bar widths > sres at tmXBMode = "Explicit" ; explicit labels > sres at tmXBLabelFontHeightF = 0.0205 > sres at tmXTLabelFontHeightF = 0.0205 > sres at tmYLLabelFontHeightF = 0.0225 > sres at tiMainFontHeightF = 0.025 > sres at tiMainFont = "helvetica" > sres at tiMainString = "Precipitation Anomalies for Mpwapwa" > sres at gsnRightString = "" > sres at tiYAxisString = "Pr Anomalies (mm/day) DJFMA" > sres at gsnYRefLine = 0. ; reference line > > do hh = 0,33 > stdarr(hh,0) = (/ (yIndex(hh::34)) /) > > if ((hh.eq.1) .or. (hh.eq.2) .or. (hh.eq.3)) then > sres at gsnXYBarChartColors = (/"pink"/) > else > sres at gsnXYBarChartColors = (/"red"/) > end if > plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(hh,0),sres) > ; draw each time series > > end do > > > sres at gsnXYBarChartColors = (/"black"/) ; > seperately, not > plot2 = gsn_csm_xy(wks,fspan(1855.8,1888.9,34),stdarr(:,1),sres) > ; advancing the frame > sres at gsnXYBarChartColors = (/"blue"/) ; > drawn on the X-axis > plot3 = gsn_csm_xy(wks,fspan(1856.4,1889.2,34),stdarr(:,2),sres) > > lbres = True ; labelbar only resources > lbres at vpWidthF = 0.2 ; labelbar width > lbres at vpHeightF = 0.1 ; labelbar height > lbres at lbBoxMajorExtentF = 0.56 ; puts space between color > boxes > lbres at lbMonoFillPattern = True ; Solid fill pattern > lbres at lbLabelFontHeightF = 0.025 ; font height. default is > small > lbres at lbLabelJust = "CenterLeft" ; left justify labels > lbres at lbPerimOn = False > lbres at lgPerimColor = "white" > colors = (/"red", "black", "blue"/) > labels = (/"Index", "Reanalysis", "CMIP5"/) > xpos = (/0.15, 0.40, 0.7/) > > do i=0,2 > lbres at lbFillColors = colors(i) > gsn_labelbar_ndc(wks,1,labels(i),xpos(i),0.20,lbres) > end do > > frame(wks) > end > > > Dr. Melissa Lazenby > Lecturer in Climate Change > Department of Geography > Chichester 1 C150 > University of Sussex > > *"Education is the most powerful weapon which you can use to change the > world" Nelson Mandela* > > > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -- Adam Phillips Associate Scientist IV, Climate Analysis Section Climate and Global Dynamics Laboratory National Center for Atmospheric Research www.cgd.ucar.edu/staff/asphilli/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Outlook-wdomdmsr.png Type: image/png Size: 24937 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Outlook-nxmphdna.png Type: image/png Size: 24937 bytes Desc: not available URL: From M.Lazenby at sussex.ac.uk Mon Feb 27 04:43:43 2023 From: M.Lazenby at sussex.ac.uk (Melissa Lazenby) Date: Mon, 27 Feb 2023 11:43:43 +0000 Subject: [ncl-talk] If statement In-Reply-To: References: Message-ID: Hi Adam Thank you very much for your help in this - it worked perfectly! Kindest Regards Melissa Dr. Melissa Lazenby Lecturer in Climate Change Department of Geography Chichester 1 C150 University of Sussex "Education is the most powerful weapon which you can use to change the world" Nelson Mandela [cid:5112fc2a-f63e-48a2-b196-b76385d5e55b] ________________________________ From: Adam Phillips Sent: Saturday, February 25, 2023 3:48 PM To: Melissa Lazenby Cc: Dennis Shea ; Ncl-talk Subject: Re: [ncl-talk] If statement Hi Melissa, I would create an array of strings pertaining to the individual bar colors, like this: bc = new(34,string) bc = "red" time = ispan(1855,1888,1) selyr = (/1857,1858,1859/) do gg = 0,dimsizes(selyr)-1 bc = where(time.eq.selyr(gg),"pink",bc) end do print(time+" "+bc) and then you can tell NCL to color each bar by the bc array: res at gsnXYBarChartColors2 = bc plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(:,0),sres) See the 2nd panel of example #6 here: https://www.ncl.ucar.edu/Applications/bar.shtml#ex6 Hope that helps! Adam On Fri, Feb 24, 2023 at 10:04 AM Melissa Lazenby via ncl-talk > wrote: Hi Dennis Many thanks for your speedy response. I have gotten confused in which variable I am trying to set. What I actually want to do is select years which appear in the x axis differently based on their certainty. For example I want to make the year 1858 show up as a pink bar instead of a red bar to show less certainty. Therefore I will need to make an if statement to reflect that for the x axis - however I have used the function fspan in my x value expression so not sure how to do this. Would this maybe work? if ((fspan.eq.1857) .or. (fspan.eq.1858) .or. (fspan.eq.1859)) then sres at gsnXYBarChartColors = (/"pink"/) else sres at gsnXYBarChartColors = (/"red"/) end if plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(:,0),sres) Many thanks for all your help! Kindest Regards Melissa Dr. Melissa Lazenby Lecturer in Climate Change Department of Geography Chichester 1 C150 University of Sussex "Education is the most powerful weapon which you can use to change the world" Nelson Mandela [cid:18685db63bd45fc2e572] ________________________________ From: Dennis Shea > Sent: Friday, February 24, 2023 2:50 PM To: Melissa Lazenby > Cc: Ncl-talk > Subject: Re: [ncl-talk] If statement I have not looked at the script but: --- do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) --- hh is a scalar. So, when (say) hh=0 stdarr(0,0) = (/ (yIndex(0::34)) /) ; ==> 35 elements of yIndex 35 elements are being assigned to one array element. NCL should have issued an error message. Maybe, I am missing something! On Fri, Feb 24, 2023 at 6:11 AM Melissa Lazenby via ncl-talk > wrote: Hi All NCL Users I am struggling with a conditional statement that I would like to perform. Essentially, I am trying to make some bars pink instead of red to show a difference in uncertainty. I have the following code below to perform this but I think there is an error with how I am looping the array. do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) if ((hh.eq.1) .or. (hh.eq.2) .or. (hh.eq.3)) then sres at gsnXYBarChartColors = (/"pink"/) else sres at gsnXYBarChartColors = (/"red"/) end if plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(hh,0),sres) ; draw each time series end do This error occurs: (0) gsn_csm_xy: Fatal: X and Y must have the same dimensions sizes, or one must be one-dimensional and both have the same rightmost dimension. Any help on this would be much appreciated! Many thanks! Kindest Regards Melissa Full Code: ;******************************************************* ; Mpwapwa.ncl ; ; Concepts illustrated: ; - Drawing multiple bar charts on a page ; - Drawing three custom legends outside a bar chart ; - Using bar charts to draw standard deviations for four time series ; - Drawing a time series plot ;******************************************************* ; ; These files are loaded by default in NCL V6.2.0 and newer load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin x = (/1856,?1857,?1858,?1859,?1860,?1861,?1862,?1863,?1864,?1865,?1866,?1867,?1868,?1869,?1870,?1871,?1872,?1873,?1874,?1875,?1876,?1877,?1878,?1879,?1880,?1881,?1882,?1883,?1884,?1885,?1886,?1887,?1888,?1889/) yIndex = (/0,2,-1,-3,2,0,0,0,0,0,0,0,0,0,0,0.05,2,0,-1,-1,-2,1,1,-2,-2,1,-1,-3,0.05,0.05,0.05,-3,0.05,0/) y20CR3 = (/-1.7049024,??-1.9956352,?0.1017878,??1.5787968,??0.2902762,??0.1615032,??0.7573914,??0.127654184,??????0.3391526,??0.18975348,?1.4533978,??0.28738338,?0.8228474,??-1.2142216,?0.67589808,?1.3983746,??1.1087944,??0.58095216,?-1.3422622,?0.226781852,??????2.173188,???0.6511904,??0.9723054,??-0.4989326,?-1.5402072,?-0.1535788,?-0.226605,??-1.6808838,?-0.19809544,??????-0.1772666,?0.0769234,??-0.6346154,?-1.2222682,?-0.0073483/) ;scaled by 5 and deleted first value to go for year 2. yCMIP5 = (/-0.9094243, 0.5458735, -0.8682191, -1.826278, -0.6501346, 0.1305088, 0.51643, 0.6247665, -0.4082086, 0.3641764, 1.476322, 0.842743, -0.5013026, -0.1281874, 0.4829363, -0.7015711, 0.269588, -0.2834916, -0.8827865, -0.4242322, -1.171241, -0.8289737, -0.4638377, 0.8812776, 0.5154026, -1.191759 ,0.8223722, -1.198702, -0.8878552, -1.724694, -1.62958, 1.02131, -1.440305, -2.299565/) stdarr = new((/34,3/),"float") do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) stdarr(hh,1) = (/ (y20CR3(hh::34)) /) stdarr(hh,2) = (/ (yCMIP5(hh::34)) /) end do print("Index Data = "+dimsizes(yIndex)+", 20CR3 = "+dimsizes(y20CR3)+", CMIP5 = "+dimsizes(yCMIP5)) printVarSummary(stdarr) ;======================================================================================??? wks = gsn_open_wks("X11","Mpwapwa_3_Plot") ; send graphics to PNG file sres = True sres at trXMinF = 1855 sres at trXMaxF = 1890 sres at tmXBValues = ispan(1855,1890,5) ; create major tickmarks with labels every 5 years sres at tmXBLabels = sres at tmXBValues sres at tmXBMinorValues = ispan(1855,1890,1) ; as tmXBMode = "Explicit", this resource needs to be set to get minor tickmarks. Create minor tickmarks every year. sres at vpWidthF = 0.8 sres at vpHeightF = 0.5 sres at vpXF = .15 sres at trYMinF = -3.5 sres at trYMaxF = 3.5 sres at gsnDraw = True ;sres at gsnFrame = False sres at gsnXYBarChart = True sres at gsnXYBarChartBarWidth = 0.20 ; change bar widths sres at tmXBMode = "Explicit" ; explicit labels sres at tmXBLabelFontHeightF = 0.0205 sres at tmXTLabelFontHeightF = 0.0205 sres at tmYLLabelFontHeightF = 0.0225 sres at tiMainFontHeightF = 0.025 sres at tiMainFont = "helvetica" sres at tiMainString = "Precipitation Anomalies for Mpwapwa" sres at gsnRightString = "" sres at tiYAxisString = "Pr Anomalies (mm/day) DJFMA" sres at gsnYRefLine = 0. ; reference line do hh = 0,33 stdarr(hh,0) = (/ (yIndex(hh::34)) /) if ((hh.eq.1) .or. (hh.eq.2) .or. (hh.eq.3)) then sres at gsnXYBarChartColors = (/"pink"/) else sres at gsnXYBarChartColors = (/"red"/) end if plot1 = gsn_csm_xy(wks,fspan(1855.6,1888.7,34),stdarr(hh,0),sres) ; draw each time series end do sres at gsnXYBarChartColors = (/"black"/) ; seperately, not plot2 = gsn_csm_xy(wks,fspan(1855.8,1888.9,34),stdarr(:,1),sres) ; advancing the frame sres at gsnXYBarChartColors = (/"blue"/) ; drawn on the X-axis plot3 = gsn_csm_xy(wks,fspan(1856.4,1889.2,34),stdarr(:,2),sres) lbres = True ; labelbar only resources lbres at vpWidthF = 0.2 ; labelbar width lbres at vpHeightF = 0.1 ; labelbar height lbres at lbBoxMajorExtentF = 0.56 ; puts space between color boxes lbres at lbMonoFillPattern = True ; Solid fill pattern lbres at lbLabelFontHeightF = 0.025 ; font height. default is small lbres at lbLabelJust = "CenterLeft" ; left justify labels lbres at lbPerimOn = False lbres at lgPerimColor ?????? = "white" colors = (/"red", "black", "blue"/) labels = (/"Index", "Reanalysis", "CMIP5"/) xpos = (/0.15, 0.40, 0.7/) do i=0,2 lbres at lbFillColors = colors(i) gsn_labelbar_ndc(wks,1,labels(i),xpos(i),0.20,lbres) end do frame(wks) end Dr. Melissa Lazenby Lecturer in Climate Change Department of Geography Chichester 1 C150 University of Sussex "Education is the most powerful weapon which you can use to change the world" Nelson Mandela [cid:18685db63bd5b2dc94e1] _______________________________________________ ncl-talk mailing list ncl-talk at mailman.ucar.edu List instructions, subscriber options, unsubscribe: https://mailman.ucar.edu/mailman/listinfo/ncl-talk _______________________________________________ ncl-talk mailing list ncl-talk at mailman.ucar.edu List instructions, subscriber options, unsubscribe: https://mailman.ucar.edu/mailman/listinfo/ncl-talk -- Adam Phillips Associate Scientist IV, Climate Analysis Section Climate and Global Dynamics Laboratory National Center for Atmospheric Research www.cgd.ucar.edu/staff/asphilli/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Outlook-wdomdmsr.png Type: image/png Size: 24937 bytes Desc: Outlook-wdomdmsr.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Outlook-nxmphdna.png Type: image/png Size: 24937 bytes Desc: Outlook-nxmphdna.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Outlook-eenhxgzr.png Type: image/png Size: 24937 bytes Desc: Outlook-eenhxgzr.png URL: