1

enter image description hereI am unable to change the labels of my ggplot + geom_point. I have tried multiple scale_shape_xxx/ scale_fill_xxx but to no avail. I would like to change the labels to 'n = 20' and 'n =50'.

library(tidyr)
library(ggplot2)

df <- data.frame(m_index, data_frame_20, data_frame_50) 
df_long <- gather(df, legend, value, -m_index)
ggplot(df_long, aes(x = m_index, y = value, colour = legend)) + geom_point() + 
labs(x = "Values of m", y = " Probability of Maximum Absolute Correlation ", 
     title = "Dot plot of probability") +
scale_shape_manual(name = 'Legend', labels = c('n = 20', 'n = 50')) 
MY.BK
  • 167
  • 1
  • 2
  • 12

0 Answers0