Skip to content

Commit 1197815

Browse files
committed
geom_polygon: make sure data is sorted
1 parent e70fb93 commit 1197815

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

R/geom-polygon.r

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ GeomPolygon <- proto(Geom, {
6060
if (n == 1) return()
6161

6262
munched <- coord_munch(coordinates, data, scales)
63+
# Sort by group to make sure that colors, fill, etc. come in same order
64+
munched <- munched[order(munched$group), ]
6365

6466
# For gpar(), there is one entry per polygon (not one entry per point).
6567
# We'll pull the first value from each group, and assume all these values

0 commit comments

Comments
 (0)