Overlay graphics with ggplot2?

1

I'm learning how to use ggplot2 and would like to make a graph and then overlap a point in it. For example:

set.seed(1)

a = data.frame(X1 = rnorm(3), X2 = rnorm(3))

g <- ggplot(a, aes(x = X1, y = X2), colour="black", fill = NA) + geom_polygon()

ponto = c(-.4, .5)

Thank you in advance!

    
asked by anonymous 12.04.2016 / 23:19

1 answer

1

A quick-and-dirty solution would be to create the dot with a data.frame .

g + geom_point(data=data.frame(x=-0.4, y=0.5), aes(x=x, y=y), colour='white')
    
13.04.2016 / 00:36