<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi,<br><br>I am trying to attach polyline to indicate some reference values in bar plots. The script runs without any error message and the bar chart plotted but without the polyline. The plot and script are attached. I appreciate any suggestions in advance.<br><br>Thanks,<br><br>Hyacinth<br><br> sres = True<br> sres@vpWidthF = 0.7<br> sres@vpHeightF = 0.5<br> ; sres@trYLog = True <br> sres@vpXF = .15<br> sres@trXMinF = 0.4<br> sres@trXMaxF = 9.6<br> sres@trYMinF = -1.0<br> sres@trYMaxF = 1.0<br> sres@gsnYRefLine = 0.0 ; create a reference line <br> sres@trXReverse = True ; Reverse X axis values<br> sres@gsnDraw = True<br> sres@gsnFrame = False<br> sres@tmXBLabelsOn = True<br> sres@gsnXYBarChart = True<br> sres@gsnXYBarChartBarWidth = 0.15 ; change bar widths<br> sres@tmXBMode = "Explicit" ; explicit labels<br> sres@tmXBValues = (/1,2,3,4,5,6,7,8,9/)<br> ; sres@tmXBLabelDeltaF = -45.0<br> sres@tmXBLabelAngleF = 90.<br> ; sres@tmXBDataLeftF = 0.2<br> sres@tmXBMajorOutwardLengthF = 0.0 ; draw tickmarks inward<br> sres@tmXBMinorOutwardLengthF = 0.0 ; draw minor ticsk inward<br> sres@tmYLMajorOutwardLengthF = 0.0 ; draw tickmarks inward<br> sres@tmYLMinorOutwardLengthF = 0.0 ; draw minor ticsk inward<br> sres@tmXBLabelFontHeightF = 0.0150<br> sres@tmXTLabelFontHeightF = 0.0205<br> sres@tmYLLabelFontHeightF = 0.0225<br> sres@tiMainFontHeightF = 0.025<br> sres@tiMainFont = "helvetica"<br> sres@tiMainString = ""<br> sres@gsnRightString = ""<br> sres@tiYAxisString = "Correlation between (u'<MAM>) and (SST'<JJA>)"<br> sres@tiYAxisFontHeightF = 0.015<br> <br> sres@gsnXYBarChartColors = (/"blue"/) <br> plot1 = gsn_csm_xy(wks,fspan(.775,8.775,9),rCL(0,:),sres) ; draw each timeseries<br> sres@gsnXYBarChartColors = (/"lightpink"/) ; seperately, not<br> plot2 = gsn_csm_xy(wks,fspan(.925,8.905,9),rCL(1,:),sres) ; advancing the frame<br> overlay(plot1,plot2)<br> plot(0) = plot1<br>;====================================================================<br>;========================================================================<br>;========================================================================<br>;========================================================================<br>; Create and add polylines @ 0.4<br>;========================================================================<br>;========================================================================<br> xb0 = (/0.4,0.4,0.4,0.4,0.4/)<br> yb0 = (/0.,0.,9.0,9.0,0.0/)<br>;========================================================================<br>;---Resources for the polyline<br> pres0 = True ; polyline mods desired<br> pres0@gsLineThicknessF = 3. ; line thickness <br> pres0@gsLineColor = "black" ; color of lines<br> pres0@gsLineDashPattern = 2<br><br>;---Attach the polyline<br> <br> gsn_add_polyline(wks,plot(0),xb0,yb0,pres0) ; <br>;**********************************************************<br>; add text labels<br>;********************************************************** <br> txres = True ; text mods desired<br> txres@txFontHeightF = 0.018 ; default size is HUGE!<br> ; txres@txAngleF = 52. ; text angle<br> txres@txJust = "CenterLeft" ; puts text on top of bars<br> <br>;====================================================================<br> lbres = True ; labelbar only resources<br> lbres@lbAutoManage = False<br> lbres@vpWidthF = 0.05 ; labelbar width<br> lbres@vpHeightF = 0.08 ; labelbar height<br> lbres@lbBoxMajorExtentF = 0.15 ; puts space between color boxes<br> lbres@lbFillColors = (/"blue","lightpink"/)<br> lbres@lbMonoFillPattern = True ; Solid fill pattern<br> lbres@lbLabelFontHeightF = 0.015 ; font height. default is small<br> lbres@lbLabelJust = "TopLeft" ; left justify labels<br> lbres@lbPerimOn = False<br> lbres@lgPerimColor = "white"<br> labels = (/"Full-CGCM","Slab-CGCM"/)<br> gsn_labelbar_ndc(wks,1,labels,0.19,0.40,lbres) ; draw right labelbar column<br> <br> lbres@lbFillColors = (/"lightpink","blue"/)<br> labels = (/"Slab-CGCM","Full-CGCM"/)<br> gsn_labelbar_ndc(wks,1,labels,0.50,0.40,lbres) ; draw right labelbar column<br> ; labels = (/"CCSM2 (T42)","OBS "/)<br> ; gsn_labelbar_ndc(wks,2,labels,0.17,0.23,lbres) ; draw left labelbar column<br>;==============================================================<br>frame(wks)<br><br><br>                                            </div></body>
</html>