Permalink
Browse files

geom_polygon: make sure data is sorted

  • Loading branch information...
1 parent e70fb93 commit 1197815c5afceb65931731cbba859bc2cde26bef @wch wch committed Oct 30, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 R/geom-polygon.r
View
@@ -60,6 +60,8 @@ GeomPolygon <- proto(Geom, {
if (n == 1) return()
munched <- coord_munch(coordinates, data, scales)
+ # Sort by group to make sure that colors, fill, etc. come in same order
+ munched <- munched[order(munched$group), ]
# For gpar(), there is one entry per polygon (not one entry per point).
# We'll pull the first value from each group, and assume all these values

0 comments on commit 1197815

Please sign in to comment.