標籤的數據點可以得到笨拙: 如何繪製漂亮間隔的數據標籤?在情節
隨機抽樣幾個標籤可能會失望:
這將是一個很好的方式來挑選一小套精美,空間數據的標籤?也就是說,要隨機挑選標籤不重疊的代表。
# demo data
set.seed(123)
N <- 50
x <- runif(N)
y <- x + rnorm(N, 0, x)
data <- data.frame(x, y, labels=state.name)
# plot with labels
plot(x,y)
text(x,y,labels)
# plot a few labels
frame()
few_labels <- data[sample(N, 10), ]
plot(x,y)
with(few_labels, text(x,y,labels))
這個例子是在R中,但它確實是一個普通的問題 – dzeltzer