I'm running a bunch of code so I can't check, but I don't think that
linetype and line colour can be used simultaneously. Try your code
without the colour=i("black") and see if it works.
Brandon
> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
The default colour is NA according to Hadley's page.
http://had.co.nz/ggplot2/geom_polygon.html
This means that the border between area's won't be shown so selecting
a linetype won't make a difference because it won't be shown. After
playing, it seems that when you define a colour you see the line, but
then linetype fails to work because you've defined a colour.
There's probably a workaround, but I don't see it.
Brandon
GeomPolygon$draw<- function (., data, scales, coordinates, ...)
{
n <- nrow(data)
if (n == 1)
return()
ggname(.$my_name(), gTree(children = gList(with(coordinates$munch(data,
scales), polygonGrob(x, y, default.units = "native",
gp = gpar(col = colour, fill = alpha(fill, alpha), lwd = size *
.pt, lty = linetype))))))
}
to Hadley:
the argument in gar in polygonGrob in gTree in ggname, linetype =
linetype should be lty = linetype.
as far as i inspected, this appears only in GeomPolygon$draw but not
in other goems.
ggplot(utah.df) +aes(long,lat,group=group,fill=LEVEL3_NAM) +
geom_polygon() +
geom_path(color="white",linetype=2) +
coord_equal() +
scale_fill_brewer("Utah Ecoregion")
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/