I am constructing a scatter plot with variables x and y. Each point is labelled using geom_text. The size of geom_text is controlled by a third variable z.
Is there a way to specify the minimum acceptable font size? I have looked at this question but it only discusses how to set the size to a fixed value.
In the example below, I have reproduced the issue using mtcars, with the size of geom_text controlled by 'disp'. It works, but some of the labels are too small to read (once the value of 'disp' gets lower than about 100).
library(ggplot2)
ggplot(mtcars, aes(y=mpg, x=cyl)) + geom_text(aes(label=rownames(mtcars),size=disp))
I'd like to be able to specify, for example, that the size is controlled by the value of 'disp', but that it should be no smaller than 3.
Obviously this would mean that the larger text was scaled up too.