From 1c6c2d2485a98ee3375f20e13be2b06b15fda53f Mon Sep 17 00:00:00 2001 From: wanghui5801 Date: Mon, 16 Dec 2024 22:43:20 +1100 Subject: [PATCH] update matrix.Rmd --- R/classes.R | 6 ++++-- vignettes/matrix.Rmd | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/R/classes.R b/R/classes.R index f2cc37a..0f5fc67 100644 --- a/R/classes.R +++ b/R/classes.R @@ -459,7 +459,8 @@ plot.pc_matrix <- function(x, status, ggplot2::element_text() else ggplot2::element_blank() - ) + ) + + ggplot2::coord_fixed(ratio = 1.1) # Add text if requested if(show_text) { @@ -769,7 +770,8 @@ plot.pc_effect <- function(x, status = "positive", add_label = TRUE, axis.line.x = ggplot2::element_line(), axis.line.y = ggplot2::element_line(), legend.key = ggplot2::element_blank() - ) + ) + + ggplot2::coord_fixed(ratio = 1.1) # Add labels if requested if (add_label) { diff --git a/vignettes/matrix.Rmd b/vignettes/matrix.Rmd index 73649c4..92f3811 100644 --- a/vignettes/matrix.Rmd +++ b/vignettes/matrix.Rmd @@ -83,19 +83,19 @@ Then we can visualize the result by `plotMatrix` function. - positive status ```{r} -plot(result, "positive") + ggplot2::coord_fixed() +plot(result, "positive") ``` - negative status ```{r} -plot(result, "negative") + ggplot2::coord_fixed() +plot(result, "negative") ``` - dark status ```{r} -plot(result, "dark") + ggplot2::coord_fixed() +plot(result, "dark") ``` We could see that there is a obvious positive connection in this system. @@ -112,5 +112,5 @@ print(effects) Then we could observe the total effect in pattern causality. ```{r} -plot(effects, status="negative") + ggplot2::coord_fixed() +plot(effects, status="negative") ``` \ No newline at end of file