13
ggplot2
에 윤곽선의 데이터 라벨을 얻는 방법을 알고 싶습니다. 감사합니다stat_contour 라인에 데이터 레이블이 있음
require(grDevices) # for colours
x <- seq(-4*pi, 4*pi, len = 27)
y <- seq(-4*pi, 4*pi, len = 27)
r <- sqrt(outer(x^2, y^2, "+"))
rx <- range(x <- 10*1:nrow(volcano))
ry <- range(y <- 10*1:ncol(volcano))
ry <- ry + c(-1, 1) * (diff(rx) - diff(ry))/2
plot(
x = 0
, y = 0
, type = "n"
, xlim = rx
, ylim = ry
, xlab = ""
, ylab = ""
)
contour(
x = x
, y = y
, z = volcano
, add = TRUE
)
library(ggplot2)
library(reshape2)
volcano3d <- melt(volcano)
names(volcano3d) <- c("x", "y", "z")
# Basic plot
v <- ggplot(volcano3d, aes(x, y, z = z))
v + stat_contour()
에서 솔루션을 따기> 당신은'방법 = "bottom.pieces을"'추가해야합니다 (또는 것 2.0.0 'top.pieces')를'direct.label' 호출에 추가합니다 – jaimedash