giovannellilab / geochem

Geochemistry pipeline for processing and visualising data from IRMS, IC and ICP-MS
https://github.com/giovannellilab/geochem
Other
0 stars 0 forks source link

Add Duchi et al. 1995 ternary cations plot #34

Closed guillecg closed 2 months ago

alebastianoni commented 3 months ago

For this ternary the only thing that you need to change are the axis... K is divided by 10 and Na by 400 gigg_tkn_duchi<-ggtern(data=subset(gigg_temp, tk %in% c("tkn")),aes(x=k/10,y=na/400, z=(sqrt(mg)))) + geom_point(size=1,shape=22,fill="black",stroke=.3) +

scale_shape_manual(values=c(4,21:25)) +

scale_fill_viridis(discrete=T, option="inferno")+

tern_limit(T=1.15,L=1.15,R=1.15)+

geom_text(mapping = aes(label = as.factor(temp)), color="black", size = 2.5, hjust=0.5, vjust = -1) + guides(fill = guide_legend(override.aes=list(shape=21)))+ labs( x = "K/10", y = "Na/400", z = expression(sqrt(Mg)), fill="samples")+

geom_line() +

theme_hidemask()+ theme_bw(base_size = 25) + theme_hidegrid_major()+ theme_nogrid_minor()+ theme_nomask()

gigg_tkn2_duchi<-ggtern(data=subset(gigg_temp, tk %in% c("tkn")),aes(x=k/10,y=na/400, z=(sqrt(mg)))) + geom_point(size=1,shape=22,fill="black",stroke=.3) +

scale_shape_manual(values=c(4,21:25)) +

scale_fill_viridis(discrete=T, option="inferno")+

tern_limit(T=1.15,L=1.15,R=1.15)+

geom_text(mapping = aes(label = as.factor(temp)), color="black", size = 2.5, hjust=0.5, vjust = -1) + guides(fill = guide_legend(override.aes=list(shape=21)))+ labs( x = "K/10", y = "Na/400", z = expression(sqrt(Mg)), fill="samples")+

geom_line() +

theme_hidemask()+ theme_bw(base_size = 25) + theme_hidegrid_major()+ theme_nogrid_minor()+ theme_nomask()

gigg_base_duchi<-gigg_tkn2_duchi + geom_point(data = subset(gigg_temp, tk %in% c("tkm")),size=1, shape=22,fill="black",stroke=.3) + geom_text(data = subset(gigg_temp, tk %in% c("tkm")), mapping = aes(label = as.factor(temp)), color="black", size = 2.5, hjust=0.5, vjust = 2) + annotate("text", label = "Fully Equilibrated", x = 0.2, y = 0.8,z=0.2, size=6,alpha=.5, fontface = "bold") + annotate("text", label = "Partially Equilibrated", x = 0.2, y = 0.225,z=0.2, size=6,alpha=.5, fontface = "bold") + annotate("text", label = "Immature Waters", x = 0.2, y=0.05,z=0.2, size=6,alpha=.5, fontface = "bold")

The end result is this: ternary_cations_duchi95_290523

guillecg commented 2 months ago

Solved in ce96b69cf43da107b52165a4b21967bed8353b7f