Re: Overlap draw of polyline and polygon.

From: Erwan Monier <emonier_at_nyahnyahspammersnyahnyah>
Date: Wed, 26 Mar 2008 19:18:01 -0700

Hi,

If you plot the polygon first and then the polyline, that should fix the
problem:

First plot polygon:

 xpm = new( (/2/), float )
 ypm = new( (/2/), float )
 xpm = (/1.,96./)
 daym = data_mean(mm)
 ypm = (/daym,daym/)

 gsres1 = True ; poly res
 gsres1_at_gsFillColor = "grey" ; color chosen
dummy1(mm) = gsn_add_polygon (wks,plot(mm),xp(mm,:),yp(mm,:),gsres1)

Then plot the polyline:

 gsres = True

 gsres_at_gsLineColor = "brown"
 gsres_at_gsLineThicknessF = 3.
 dummy0(mm) = gsn_add_polyline(wks,plot(mm),xpm,ypm,gsres)

I hope it works the way you want,
Erwan

Wang, Yi wrote:
> Hi Folks:
>
> How can I avoid the polyline to be overlaid by polygon in a simple XY plot?
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> gsres = True ; now draw
> ;;;;significance
> xpm = new( (/2/), float )
> ypm = new( (/2/), float )
> xpm = (/1.,96./)
> daym = data_mean(mm)
> ypm = (/daym,daym/)
> gsres_at_gsLineColor = "brown"
> gsres_at_gsLineThicknessF = 3.
> dummy0(mm) = gsn_add_polyline(wks,plot(mm),xpm,ypm,gsres)
>
> gsres1 = True ; poly res
> gsres1_at_gsFillColor = "grey" ; color chosen
> dummy1(mm) = gsn_add_polygon (wks,plot(mm),xp(mm,:),yp(mm,:),gsres1)
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> The above plots are in the do-loop. However, my polygon plot (dummy1) covers
> the polyline plot (dummy0).
>
> I found this by commenting out the dummy1 line there.
>
> Thanks,
>
> Yi Wang, PhD
> Pacific Northwest National Lab
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Mar 26 2008 - 20:18:01 MDT

This archive was generated by hypermail 2.2.0 : Mon Mar 31 2008 - 09:11:46 MDT