Thank Adam. I managed to get what I want with gsn_add_polygon.<br><br>Noel<br><br><br><div class="gmail_quote">On Fri, Jul 20, 2012 at 12:31 PM, Adam Phillips <span dir="ltr"><<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi Noel,<br>
The boxes created by boxplot are drawn by multiple calls to
gsn_polyline. Thus, there is no way to automatically fill the boxes.
(This could be a possible upgrade in the future, however the
function would need to be completely rewritten to do this.) <br>
<br>
To draw boxes around the boxes, you can call gsn_add_polygon:<br>
<a href="http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_add_polygon.shtml" target="_blank">http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_add_polygon.shtml</a><br>
Note that you need to call draw and frame after you call
gsn_add_polygon. So the order of calling would be:<br>
boxplot<br>
gsn_add_polygon<br>
draw<br>
frame<br>
<br>
Good luck,<br>
Adam<div><div class="h5"><br>
<br>
On 7/20/12 9:46 AM, Noel Aloysius wrote:
</div></div><blockquote type="cite"><div><div class="h5">Hi NCL,<br>
<br>
I created a box plot comparing annual and seasonal changes in
precipitation projections (plot attached).<br>
<br>
I want to know if I can fill the boxes red and green. What is the
plot resource that does this?<br>
<br>
I also want to draw a box around {black and red} and {blue and
green} boxes, so that they are grouped together for increased
emphasis.<br>
<br>
The relevant code section is attached. <br>
<br>
Thanks in advance for your help,<br>
<br>
;***************************************************************************<br>
<br>
patSeasons =
(/0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19/)<br>
wks = gsn_open_wks(type,diro +
"pr_change_2150_boxplot") ; create postscript file<br>
<br>
;------------ resources for plot background<br>
res =
True ; plot
mods desired<br>
res@tmXBLabels = (/" ","Ann"," ","DJF"," ","MAM"," ","JJA","
","SON",\<br>
" ","Ann"," ","DJF"," ","MAM","
","JJA"," ","SON"/) ; labels for each box, Jan-Dec<br>
res@tmXBLabelFontHeightF = 0.01<br>
res@trYMinF = -25.0<br>
res@trYMaxF = 25.0<br>
res@vpHeightF = 0.3<br>
res@vpWidthF = 0.7<br>
<br>
;------------ resources for polylines that draws the boxes<br>
llres = True <br>
llres@gsLineThicknessF = 2.5 ; line thickness <br>
<br>
;------------ resources that control color and width of boxes<br>
opti = True <br>
opti@boxWidth = .8 ; Width of box (x <br>
opti@boxColors =
(/"black","red","black","red","black","red","black","red","black","red",\<br>
"blue","green","blue","green","blue","green","blue","green","blue","green"/)<br>
<br>
plot = boxplot(wks,patSeasons,patArrSeason,opti,res,llres)<br>
<br>
draw(wks) <br>
frame(wks) <br>
<br>
;*****************************************************************************<br>
<br clear="all">
<br>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br>