My troubles started when I had a variable with more than 6 values because that is the current maximum value for the scale_shape function in ggplot2.
Due to that problem
here is an example:
plot1 <- ggplot(dataf, aes(x=Density, y=Growth, colour=Municipality,
shape=Municipality))
plot1 <- plot1 + geom_point(size=3)
plot1 <- plot1 + scale_colour_discrete() +
scale_shape_manual(values=as.numeric(dataf$Shape))
plot1
if you need filled shapes, then replace with
scale_shape_manual(values=c(16, 17, 15, 3, 7, 8)[as.numeric(dataf$Shape)])
the tricks are: