EDIT: updating for ggplot version 0.9.2
The original answer (see below) broke at about version 0.9.0 or 0.9.1. The following works in 0.9.2
# Some toy data
df <- expand.grid(x = factor(seq(1:5)), y = factor(seq(1:5)), KEEP.OUT.ATTRS = FALSE)
df$Count = seq(1:25)
# A plot
library(ggplot2)
p = ggplot(data = df, aes( x = x, y = y, label = Count, size = Count)) +
geom_point(colour = NA) +
geom_text(show.legend = FALSE) +
guides(size = guide_legend(override.aes = list(colour = "black", shape = utf8ToInt("N")))) +
scale_size(range = c(2, 10))
p
Original answer
Answering my own question and using the snippet of code in @kohske's comment above:
# Some toy data
df <- expand.grid(x = factor(seq(1:5)), y = factor(seq(1:5)), KEEP.OUT.ATTRS = FALSE)
df$Count = seq(1:25)
# A plot
library(ggplot2)
p = ggplot(data = df, aes( x = x, y = y, label = Count, size = Count)) +
geom_text() +
scale_size(range = c(2, 10))
p
library(grid)
grid.gedit("^key-[-0-9]+$", label = "N")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…