플롯에서 범례를 변경하는 데 문제가 있습니다. 내가 상징을 꾸미고 있기 때문에, 나는 상징으로 나의 전설을 원한다. 그것은 간단해야하지만, 그것이 최선의 방법인지 모르겠습니다.범례를 기호로 바꾸는 방법 ggplot
dat <- dput(dmam[1:3,])
structure(list(A = c(20.3962664097025, 23.1851978051035, 24.100067818374
), C = c(21.3308712003524, 18.9836301631049, 18.0438507268565
), E = c(4.65577231445595, 5.31932828758369, 7.38133268738002
), N = c(7.27444462203666, 7.05405386380459, 6.86223246170241
), NE = c(3.17580210229611, 3.61284920419648, 4.61289092127168
), NW = c(9.24999105407481, 7.474673429406, 5.15097610969423),
S = c(7.5472564395321, 7.66985191633565, 8.38928522440817
), SE = c(2.93704709971095, 2.86345108676898, 4.23877287952622
), SW = c(6.66026053678963, 6.92699394482923, 5.47572225923119
), U = c(3.66624356005668, 5.29918120412581, 8.3455794646421
), W = c(13.1060448390873, 11.6107893469172, 7.3992896902522
), mod = c("BNU-ESM", "CCSM4", "CESM1-CAM5"), id = 1:3), .Names = c("A",
"C", "E", "N", "NE", "NW", "S", "SE", "SW", "U", "W", "mod",
"id"), row.names = c("BNU-ESM", "CCSM4", "CESM1-CAM5"), class = "data.frame")
내가 무슨 짓을 :
이 df <- melt(dat,id=c('mod','id'))
s <- ggplot(df, aes(variable,value))
s <- s + geom_point(aes(shape = id,colour=mod), size = 3) +
scale_shape_identity()
그러나 전설 기호를 표시되지 ...
'scale_shape_manual (값 = C를 (2,3)) # 변경 shapes' –