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:
As shown in this 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%)]
As Suggested
Suppose iris data set head(iris)
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
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 setosa5.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
scale_x_continuous()
and setting thebreaks
argument to the values you want? - Ben G