<div dir="ltr"><div>Thanks Rashed, it worked.</div><div><br></div><div>Debasish</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 9, 2018 at 2:29 PM, Rashed Mahmood <span dir="ltr"><<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Debasish,<br></div>Try the following:<span><br><br><br>begin<br>     arr =    (/2569,7000,12.25,81.65,58.8/)<br>     minval = (/541,2190,7.83,49.33,38.88/)<br>     maxval = (/4006,10456,19.34,137.7,77.<wbr>42/)<br><br></span> wks_type = "x11"<span><br> wname = "bar"<br>   wks = gsn_open_wks(wks_type,wname)<br>;*****************************<wbr>*******************<br>; create panel plots<br>;*****************************<wbr>********************<br>  res            = True<br>  res@gsnDraw  = False<br>  res@gsnFrame = False<br>  res@gsnXYBarChart = True                 ; plot mods desired<br></span>  res@trYMinF       = 0<br>  res@trYMaxF       = max(maxval)+0.1*max(maxval)<span><br>  lres                   = True                    ; polyline mods desired<br>  lres@gsLineColor       = "black"<br>  lres@gsLineThicknessF  = 2.5                     ; thickness of lines<br>  lres@gsLineDashPattern = 0<br>  lres@gsLineColor       = "gray50"<br><br>   plot = gsn_csm_xy(wks,ispan(1,5,1),<wbr>arr,res)<br><br></span> dum = new(dimsizes(arr),graphic)<br> x = ispan(1,5,1)<br> do n=0,dimsizes(dum)-1<br>    dum(n) = gsn_add_polyline(wks,plot,(/x(<wbr>n),x(n)/),(/minval(n),maxval(<wbr>n)/),lres)<br> end do<br> draw(plot)<br> frame(wks)<br>;***********<br>end<br><br><br></div>Each y-error is drawn separately. There is also a simple function here for adding error bars (example 12):<br><a href="https://www.ncl.ucar.edu/Applications/Scripts/scatter_12.ncl" target="_blank"></a><div><br><a href="https://www.ncl.ucar.edu/Applications/scatter.shtml" target="_blank">https://www.ncl.ucar.edu/<wbr>Applications/scatter.shtml</a><br><br><br></div><div>Cheers,<br></div><div>Rashed<br></div><div><br><br><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, Mar 9, 2018 at 10:56 AM, Debasish Hazra <span dir="ltr"><<a href="mailto:debasish.hazra5@gmail.com" target="_blank">debasish.hazra5@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><div class="h5"><div dir="ltr"><div>I am trying to do a barplot with vertical error bars that will show the range. But the figure shows bars only, with any error bars associated. What is needed to add error bars in the figure ? </div><div><br></div><div>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_code.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_csm.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/contributed.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/shea_util.ncl"<br>;*****************************<wbr>***************<br>begin</div><div>     arr =    (/2569,7000,12.25,81.65,58.8/)<br>     minval = (/541,2190,7.83,49.33,38.88/)<br>     maxval = (/4006,10456,19.34,137.7,77.42<wbr>/)</div><div><br></div><div> wks_type = "png"<br> wname = "bar"<br>   wks = gsn_open_wks(wks_type,wname)</div><div>;*****************************<wbr>*******************<br>; create panel plots<br>;*****************************<wbr>********************</div><div>  res            = True<br>  res@gsnDraw  = False<br>  res@gsnFrame = False<br>  res@gsnXYBarChart = True                 ; plot mods desired<br>  lres                   = True                    ; polyline mods desired<br>  lres@gsLineColor       = "black"<br>  lres@gsLineThicknessF  = 2.5                     ; thickness of lines<br>  lres@gsLineDashPattern = 0<br>  lres@gsLineColor       = "gray50"</div><div>  </div><div>   plot = gsn_csm_xy(wks,ispan(1,5,1),ar<wbr>r,res)</div><div>   dum = gsn_add_polyline(wks,plot,minv<wbr>al,maxval,lres)</div><div>  </div><div> draw(plot)<br>  frame(wks)</div><div>;*****************************<wbr>***************<br>end</div><div><br></div><div>Thanks.</div><span class="m_8721453659931573342HOEnZb"><font color="#888888"><div>Debasish</div></font></span></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" rel="noreferrer">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>