使用 ggtern 增加三元图中轴标签的大小

问题描述 投票:0回答:1

当使用以下代码时,我想增加三元图的大小:

# Dataset
NP_Mobj
    EE   ES   SE id
1 0.15 0.25 0.60  1
2 0.30 0.20 0.50  1
3 0.15 0.15 0.70  1
4 0.40 0.20 0.40  1
5 0.70 0.10 0.20  1
6 0.50 0.30 0.20  1
7 0.32 0.20 0.48  2
idNP  <- "1";   idMObj <- "2";
Group <- as.factor(NP_Mobj$id)
 IWRM_Trinagle_NPCriteria_MObj <-  ggtern(NP_Mobj, aes(
    x = SE,
    y = EE,
    z = ES
  ))                                                    + 
    geom_point(aes(color = Group ), size = 8)           + 
    theme_showarrows()                                  +
    labs(xarrow = "Social equity (SE)",
         yarrow = "Economic efficiency (EE)",
         zarrow = "Environmental sustainability (ES)")  +
    scale_colour_manual(breaks = c(idNP, idMObj),
                        values = c("black", "red"))     +
    theme_clockwise() + theme_bw()
IWRM_Trinagle_NPCriteria_MObj <- IWRM_Trinagle_NPCriteria_MObj +  theme(legend.position="none")

我想增加三个轴标签和轴值的大小。

r ggplot2 axis ternary ggtern
1个回答
0
投票

您可以使用

axis.title
axis.text
theme()
参数来更改轴标题和文本的外观。

library(ggtern)
ggtern(NP_Mobj, aes(
  x = SE,
  y = EE,
  z = ES
))                                                    + 
  geom_point(aes(color = Group ), size = 8)           + 
  theme_showarrows()                                  +
  labs(xarrow = "Social equity (SE)",
       yarrow = "Economic efficiency (EE)",
       zarrow = "Environmental sustainability (ES)")  +
  scale_colour_manual(breaks = c(idNP, idMObj),
                      values = c("black", "red"))     +
  theme_clockwise() + 
  theme_bw() +  
  theme(legend.position="none", 
        axis.text = element_text(size = 18),
        axis.title = element_text(size = 20))

© www.soinside.com 2019 - 2024. All rights reserved.