Friday, March 9, 2018

r - How can I set x and y axis in a scatter chart (ggplot)?

I´m making a simple scatter chart using ggplot. This is my data (GDJan):




  Name    DNN     DSIDM   DIDMM  Result                  

1 RS -11 -32.9 0.473 NNC
2 MA -9 -39.5 0.160 NNC
3 P 0 -5.7 -0.335 QNC
4 Q 34 132.0 -1.06 NNS


I would like to set the x axis (DIDMM) between -3 and 3. Also set the y axis (DNN) between -15 and 40.




That is my code:



ggplot(data = GDJan, mapping = aes(x = DIDMM, y = DNN)) +
+ geom_point() +
+ geom_label(aes(label = Indice))


Sorry if this question is too simple, I did a reseach here and on internet but all the related answers I found were for complicated charts. I´m learning, very new using R. I hope someone can help or show me where can I find a answer.

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...