nicholasehamilton / ggtern

Extension to ggplot2 for plotting ternary diagrams
www.ggtern.com
55 stars 14 forks source link

how to increase font size and change face || bring title to the center #45

Open complexgenome opened 3 years ago

complexgenome commented 3 years ago

Hi Nicholas,

Thanks for awesome library.

I'm interested to use to to create ancestry related graphics. The plot is constructed beautifully. However, I'm looking to enhance the graphics by two further things: 1) a) make the axis ticks in bold, increase their font size, and b) the ancestries (anc1, anc2, and anc3 in this case) font bigger and bold. 2) I'd like to bring the plot title in the middle, that is right above the triangle, which at the moment is sort of left aligned.


set.seed(4)
sample_data<-data.table( anc1= c(rep(10,3),rep(20,4), rep(30,3)) , anc2=c(rep(50,3),rep(10,4), rep(65,3)) , anc3=c(rep(40,3),rep(70,4), rep(5,3)))

CairoTIFF(filename = "sample.tiff", height=800, width=900)

## theme_void is good
ggtern::ggtern(data=sample_data,aes(x=anc1,y=anc2, z=anc3))  +  theme_rgbw( ) + ggtern::theme_nogrid()  + geom_point(color="black",size=3.5,alpha=0.4)+
 labs(title="Ternary plot for ancestry")  

dev.off()

I've tried tinkering with geom_text but that doesn't help, I've tried to play within the theme_rgbw but it doesn't allow changes.

Thanks~

I'm using ggtern_3.3.0, ggplot2_3.3.2 and R v4.0