Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smallest size of GGplot2 geom_text()

Tags:

r

ggplot2

I have a plot made with GGplot2. Now when i want to change the size of my text points within the plot, the size of the text does not change. I use the following line of code:

ggplot(data = out, aes(x = V2, y = V1)) +
    ****geom_text(data = out[!is.na(out$V1),], aes(label = labels, alpha=0.3, size=0.1))**** +
    facet_grid(id1 ~ id2,scales="fixed")+
    geom_text(data=df.text,aes(pos,pos,label=id1)) + geom_abline( slope=1 ) + 
    ggtitle("Corralation between measured & calculated affinities") +
    ylab("") + xlab("") + theme(panel.grid.minor.x=element_blank(), panel.grid.major.x=element_blank())
}

I put ** between start and end of the line of interest fat. I know that size is the right parameter to change, but why isn't my text changing when for instance making size=0.01.

like image 844
Sander Van der Zeeuw Avatar asked May 07 '13 13:05

Sander Van der Zeeuw


1 Answers

Thanks to Adam Kimberley, the size parameter should be moved outside of the 2nd brackets like this geom_text(data = out[!is.na(out$V1),], aes(label = labels), size=0.1, alpha=0.3) Than size of the text alters.

like image 110
Sander Van der Zeeuw Avatar answered Sep 21 '22 03:09

Sander Van der Zeeuw