Forgot to push “reply all” yesterday. Here is my comment again. If you want to manually change the size without wanting to use log transformation inside scale_size () function, then you can transform the data before you do ggplot. I would better do transformation while creating ggplot.
data <- data.frame(X=-30:30, Y=sample(1:100, size=61), T=exp(runif(61, 1, 10)),
L=sample(letters, size=61, replace=TRUE))
data$T <- log(data$T)
g <- ggplot(data=data, aes(x=X, y=Y, size=T, label=L))
g <- g + geom_text() + scale_size(range = c(5, 20))
print(g)
HTH
Sathish
From: Srinivasan, Sathish K
Sent: Thursday, September 20, 2012 5:21 PM
To: 'Tobee'
Subject: RE: Manual labels in legend for a continuous size?
Try something like this
data <- data.frame(X=-30:30, Y=sample(1:100, size=61), T=exp(runif(61, 1, 8)),
L=sample(letters, size=61, replace=TRUE))
g <- ggplot(data=data, aes(x=X, y=Y, size=T, label=L))
g <- g + geom_text() + scale_size(trans="log10", range=c(3, 18))
print(g)
The maximum power of e for “T” can be tried with different numbers.
Log transformation can be toggled between 2, 10 or any.
HTH,
-Sathish
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2