Please note I am beginner with R. I have merged two data frames with one common column with merge() method. I have obtained data frame like:
x y1 y2
1 3 5
2 2 4
1 2 2
3 5 5
...
etc. i would like to plot such data frame with ggplot. What I have created (using documention of geom_point is
ggplot(data = dat_c, aes(games, variance.x)) +
geom_point(aes(x = games, y = variance.x), legend= TRUE, xlab="X", ylab="Y", colour=alpha('red', 0.05)) +
geom_point(aes(x = games, y = variance.y), legend = TRUE, colour=alpha('blue', 0.05) )
It works, NaNs do not disturb me because I get warning that they are ignored, which is fine. However I have two problems and I am not sure how to fix them:
- my actual plot is located at the bottom-left corner, I would like to set max values for X and Y axis (in a dynamic manner, for example with highest value from data + 100 or something like this)
- the legend is not displayed
- the axis are not described
Here is how it looks hlike: