0
votes

This is the code:

ggplot(percent, aes(x = user_id , y = percentage, label = final_rank)) + 
geom_text(check_overlap = TRUE, nudge_y = 5,nudge_x = 1,size = 5, color = "blue") + 
geom_point(color = "red")`

This is the Plot I am getting:

Plot between User Ids and Percentage of Prediction.

As shown in this image

The Final Prediction, csv file image

the x-axis values were default as 1000, 2000 etc and y-axis default values 25, 75, 100 etc. But I want the x-axis values to be changed as respective user_ids (1163, 2080 = in x-axis) and prediction percentage(0.91,0.833 etc = in y-axis) like = 1,2,3 points are showing ranks respective to user_id and percentage. [1163 rank is 1 with 0.91(91%), 2080 rank is 2 with 0.83(83%)]

I want plot as shown in this image

As Suggested Suppose iris data set head(iris)
Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa 2 4.9 3.0 1.4 0.2 setosa 3 4.7 3.2 1.3 0.2 setosa 4 4.6 3.1 1.5 0.2 setosa 5 5.0 3.6 1.4 0.2 setosa 6 5.4 3.9 1.7 0.4 setosa
so after taking Sepal.Length in x-axis and Sepal.Width in y-axis. I need x-axis labels need to be respective as shown above. Like x-axis need to be 5.1 4.9 and y-axis need to be 3.5 3.0 with respective species setosa in the plots iris dataset. Not as in plot 7.0 , 7.5 breaks and 6 , 7 , 8 breaks

1
Please post your data. Also, have you tried adding scale_x_continuous() and setting the breaks argument to the values you want? - Ben G
@BenG Data is as shown in IMAGE -> The Final Prediction, csv file image (file name). or consider the data may be whatever and also tried scale_x_continuous() but not getting the output. - SANDESH SAMAKA
Still, if you would post some random data, it would be much easier for everyone to recreate your problem.. otherwise everyone has to create some dummy data in order to help you, which is slighlty annoying.. - SeGa
@SeGa Suggested edits are added to my question thank you and please correct me if I am anywhere wrong and thanks in advance - SANDESH SAMAKA

1 Answers

0
votes

Try this . . .

library(tidyvsere)

iris %>%
  filter(Species == "setosa") %>%
    ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) + 
    geom_point() +
    scale_x_continuous(breaks = iris$Sepal.Length)