I have a contour plot and I would like to add a geom_path with a different set of data over it.
Right now I have the below code, but as soon as it gets to the geom_path, it overwrites the contour plot. Is there a way to prevent this from happening?
v <- ggplot(pts, aes(theta_1, theta_2, z = z))
v + stat_contour(aes(colour = ..level..),bins=50) + xlab(expression(Theta[1])) + ylab(expression(Theta[2]))
v+geom_path(aes(x=x,y=y,z=z), data=some.mat)
probably you can do by:
v <- ggplot(pts, aes(theta_1, theta_2, z = z))
v <- v + stat_contour(aes(colour = ..level..),bins=50) + xlab(expression(Theta[1])) + ylab(expression(Theta[2]))
v + geom_path(aes(x=x,y=y,z=z), data=some.mat)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With