Hi:
When i was using as.ggplot() convert points() to ggplot objects, then add some points with geom_point() in the plots, i found that the points drawn using points() and geom_point() are in different positions.
Here is my code:
plot_f <- function(){
plot.new()
points(df[, 1:2], cex=0.6, col=2, pch=2)
}
p <- as.ggplot(
~plot_f()
)
p <- p +
geom_point(
data = df,
aes(x = df[,1], y = df[,2]),
size = 4
)
Hi: When i was using as.ggplot() convert points() to ggplot objects, then add some points with geom_point() in the plots, i found that the points drawn using points() and geom_point() are in different positions.
Here is my code:
df is a data frame :
the result p is:
Could you tell how to solve the problem?
Thanks!