If you have a large number of values you can dodge the labels in axis, here an example:
library(ggplot2)
#Code
ggplot(mdf,aes(x=factor(Band),y=R.squared))+
geom_point()+
scale_x_discrete(guide = guide_axis(n.dodge=2))+
coord_flip()
Output:
Some data used:
#Data
mdf <- structure(list(Band = c(402, 411, 419, 427, 434, 412, 421, 429,
437, 444, 422, 431, 439, 447, 454, 432, 441, 449, 457, 464),
R.squared = c(0.044655015122032, 0.852028718800355, 0.818617476505653,
0.825782272278991, 0.860844967662728, 0.044655015122032,
0.852028718800355, 0.818617476505653, 0.825782272278991,
0.860844967662728, 0.044655015122032, 0.852028718800355,
0.818617476505653, 0.825782272278991, 0.860844967662728,
0.044655015122032, 0.852028718800355, 0.818617476505653,
0.825782272278991, 0.860844967662728), Adj.Rsquared = c(-0.0614944276421867,
0.835587465333728, 0.798463862784058, 0.806424746976656,
0.845383297403031, -0.0614944276421867, 0.835587465333728,
0.798463862784058, 0.806424746976656, 0.845383297403031,
-0.0614944276421867, 0.835587465333728, 0.798463862784058,
0.806424746976656, 0.845383297403031, -0.0614944276421867,
0.835587465333728, 0.798463862784058, 0.806424746976656,
0.845383297403031), Intercept = c(0.000142126282140086, -0.00373545760470339,
-0.00258909036368109, 0.000626075834918527, -3.3448513588372e-05,
0.000142126282140086, -0.00373545760470339, -0.00258909036368109,
0.000626075834918527, -3.3448513588372e-05, 0.000142126282140086,
-0.00373545760470339, -0.00258909036368109, 0.000626075834918527,
-3.3448513588372e-05, 0.000142126282140086, -0.00373545760470339,
-0.00258909036368109, 0.000626075834918527, -3.3448513588372e-05
), Slope = c(-0.00108714482110104, 0.393380133190131, 0.443463459485279,
0.503881831479685, 0.480162723468755, -0.00108714482110104,
0.393380133190131, 0.443463459485279, 0.503881831479685,
0.480162723468755, -0.00108714482110104, 0.393380133190131,
0.443463459485279, 0.503881831479685, 0.480162723468755,
-0.00108714482110104, 0.393380133190131, 0.443463459485279,
0.503881831479685, 0.480162723468755)), row.names = c(NA,
-20L), class = "data.frame")
The suggestion from @DaveArmstrong is very helpful too (Many thanks and credits to him):
#Code 2
ggplot(mdf,aes(x=reorder(factor(Band), R.squared, mean),y=R.squared))+
geom_point()+
scale_x_discrete(guide = guide_axis(n.dodge=2))+
coord_flip()
Output:
Another option:
#Code 3
ggplot(mdf,aes(x=reorder(factor(Band), R.squared, mean),y=R.squared))+
geom_point()+
geom_segment( aes(x=reorder(factor(Band), R.squared, mean),
xend=reorder(factor(Band), R.squared, mean),
y=0,
yend=R.squared))+
scale_x_discrete(guide = guide_axis(n.dodge=2))+
coord_flip()
Output: