<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Dear All NCL Users</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">I hope you are well. </span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">I am trying to make a bar plot that has 4 bars per year in a times series from 1856-1889. </span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">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. </span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">I have used the fspan option like the example for unique 5 does but it does not seem to
be working. </span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">I also am having issues with my x axis labels being the years. </span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Any help to rectify this issue would be greatly appreciated. Below are the output of the
figure and code.</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Many thanks!</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Kindest Regards</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Melissa</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><img style="max-width:100%" class="ContentPasted0 w-757 h-668" size="35799" contenttype="image/png" data-outlook-trace="F:1|T:1" src="cid:ca412424-01ff-428f-aa69-83fa199caebf"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted1">;*******************************************************
<div class="ContentPasted1">; Mpwapwa_unique_5.ncl</div>
<div class="ContentPasted1">;</div>
<div class="ContentPasted1">; Concepts illustrated:</div>
<div class="ContentPasted1">; - Drawing multiple bar charts on a page</div>
<div class="ContentPasted1">; - Drawing three custom legends outside a bar chart</div>
<div class="ContentPasted1">; - Using bar charts to draw standard deviations for four time series</div>
<div class="ContentPasted1">; - Drawing a time series plot</div>
<div class="ContentPasted1">;*******************************************************</div>
<div class="ContentPasted1">;</div>
<div class="ContentPasted1">; These files are loaded by default in NCL V6.2.0 and newer</div>
<div class="ContentPasted1">; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div>
<div class="ContentPasted1">; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1">begin</div>
<div class="ContentPasted1"> </div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1">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/)</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1">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/)</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1">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/)</div>
<div><br class="ContentPasted1">
</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1">;scaled by 10</div>
<div class="ContentPasted1">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/)</div>
<div><br class="ContentPasted1">
</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1">;scaled by 5</div>
<div class="ContentPasted1">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/)</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1">;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/)</div>
<div><br class="ContentPasted1">
</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1"> stdarr = new((/34,4/),"float")</div>
<div class="ContentPasted1"> do hh = 0,33</div>
<div class="ContentPasted1"> stdarr(hh,0) = (/ (yIndex(hh::34)) /)</div>
<div class="ContentPasted1"> stdarr(hh,1) = (/ (y20CR3(hh::34)) /)</div>
<div class="ContentPasted1"> stdarr(hh,2) = (/ (yLMR(hh::34)) /)</div>
<div class="ContentPasted1"> stdarr(hh,3) = (/ (yCMIP5(hh::34)) /)</div>
<div class="ContentPasted1"> end do</div>
<div class="ContentPasted1"> print("Index Data = "+dimsizes(yIndex)+", 20CR3 = "+dimsizes(y20CR3)+", LMR = "+dimsizes(yLMR)+", CMIP5 = "+dimsizes(yCMIP5))</div>
<div><br>
</div>
<div class="ContentPasted1">;====================================================================================== </div>
<div class="ContentPasted1"> wks = gsn_open_wks("X11","Mpwapwa_4_Plot") ; send graphics to PNG file</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1"> sres = True</div>
<div class="ContentPasted1"> sres@vpWidthF = 0.7</div>
<div class="ContentPasted1"> sres@vpHeightF = 0.5</div>
<div class="ContentPasted1"> sres@vpXF = .15</div>
<div class="ContentPasted1"> sres@trYMinF = -3.5</div>
<div class="ContentPasted1"> sres@trYMaxF = 3.5</div>
<div class="ContentPasted1"> sres@gsnDraw = True</div>
<div class="ContentPasted1"> sres@gsnFrame = False</div>
<div class="ContentPasted1"> sres@gsnXYBarChart = True</div>
<div class="ContentPasted1"> sres@gsnXYBarChartBarWidth = 0.20 ; change bar widths</div>
<div class="ContentPasted1"> sres@tmXBMode = "Explicit" ; explicit labels</div>
<div class="ContentPasted1"> sres@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/)</div>
<div class="ContentPasted1"> ;sres@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/)</div>
<div class="ContentPasted1"> sres@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"/)</div>
<div class="ContentPasted1"> sres@tmXBLabelFontHeightF = 0.0205</div>
<div class="ContentPasted1"> sres@tmXTLabelFontHeightF = 0.0205</div>
<div class="ContentPasted1"> sres@tmYLLabelFontHeightF = 0.0225</div>
<div class="ContentPasted1"> sres@tiMainFontHeightF = 0.025</div>
<div class="ContentPasted1"> sres@tiMainFont = "helvetica"</div>
<div class="ContentPasted1"> sres@tiMainString = "Precipitation Anomalies for all 4 datasets"</div>
<div class="ContentPasted1"> sres@gsnRightString = ""</div>
<div class="ContentPasted1"> sres@tiYAxisString = "Pr Anomalies (mm/day)"</div>
<div class="ContentPasted1"> sres@gsnYRefLine = 0. ; reference line </div>
<div class="ContentPasted1"> </div>
<div class="ContentPasted1"> sres@gsnXYBarChartColors = (/"red"/) </div>
<div class="ContentPasted1"> plot1 = gsn_csm_xy(wks,fspan(.775,33.775,34),stdarr(:,0),sres) ; draw each time series</div>
<div class="ContentPasted1"> sres@gsnXYBarChartColors = (/"lightblue"/) ; seperately, not</div>
<div class="ContentPasted1"> plot2 = gsn_csm_xy(wks,fspan(.925,33.925,34),stdarr(:,1),sres) ; advancing the frame</div>
<div class="ContentPasted1"> sres@gsnXYBarChartColors = (/"blue"/) ; but tweaking where</div>
<div class="ContentPasted1"> plot3 = gsn_csm_xy(wks,fspan(1.075,34.075,34),stdarr(:,2),sres) ; each time series is</div>
<div class="ContentPasted1"> sres@gsnXYBarChartColors = (/"green"/) ; drawn on the X-axis</div>
<div class="ContentPasted1"> plot4 = gsn_csm_xy(wks,fspan(1.225,34.225,34),stdarr(:,3),sres)</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1"> lbres = True ; labelbar only resources</div>
<div class="ContentPasted1"> lbres@vpWidthF = 0.2 ; labelbar width</div>
<div class="ContentPasted1"> lbres@vpHeightF = 0.1 ; labelbar height</div>
<div class="ContentPasted1"> lbres@lbBoxMajorExtentF = 0.36 ; puts space between color boxes</div>
<div class="ContentPasted1"> lbres@lbFillColors = (/"green","blue"/)</div>
<div class="ContentPasted1"> lbres@lbMonoFillPattern = True ; Solid fill pattern</div>
<div class="ContentPasted1"> lbres@lbLabelFontHeightF = 0.025 ; font height. default is small</div>
<div class="ContentPasted1"> lbres@lbLabelJust = "CenterLeft" ; left justify labels</div>
<div class="ContentPasted1"> lbres@lbPerimOn = False</div>
<div class="ContentPasted1"> lbres@lgPerimColor = "white"</div>
<div class="ContentPasted1"> labels = (/"CMIP5","20CR3"/)</div>
<div class="ContentPasted1"> gsn_labelbar_ndc(wks,2,labels,0.52,0.23,lbres) ; draw right labelbar column</div>
<div class="ContentPasted1"> </div>
<div class="ContentPasted1"> lbres@lbFillColors = (/"lightblue","red"/)</div>
<div class="ContentPasted1"> labels = (/"LMR","Index"/)</div>
<div class="ContentPasted1"> gsn_labelbar_ndc(wks,2,labels,0.17,0.23,lbres) ; draw left labelbar column</div>
<div class="ContentPasted1"> frame(wks) </div>
<div class="ContentPasted1">end</div>
<br>
</span></div>
<div class="elementToProof">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div style="font-family:Tahoma; font-size:13px"></div>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">Dr. Melissa Lazenby
<div>Lecturer in Climate Change</div>
<div>Department of Geography</div>
<div>Chichester 1 C150</div>
<div>University of Sussex</div>
<div><br>
</div>
<div><i style="color: inherit; font-family: inherit; font-size: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;">"Education is the most powerful weapon which you can use to change the world" Nelson Mandela</i><br>
</div>
<div><i style="color: inherit; font-family: inherit; font-size: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;"><br>
</i></div>
<div><i style="color: inherit; font-family: inherit; font-size: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;"><img style="max-width:100%" data-outlook-trace="F:1|T:1" src="cid:d803561d-88ff-4fe1-9c8c-2ccee5c3b54c"><br>
</i></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>