diff --git a/DESCRIPTION b/DESCRIPTION index d990b08..db0fcfb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,11 +16,12 @@ Depends: ggplot2 Imports: reshape2, - stats + stats, + ggtext Suggests: knitr, spelling URL: http://www.sthda.com/english/wiki/ggcorrplot BugReports: https://github.com/kassambara/ggcorrplot/issues -RoxygenNote: 7.1.0 +RoxygenNote: 7.1.2 Language: en-US diff --git a/NAMESPACE b/NAMESPACE index 2ff62cc..4c51180 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,3 +3,4 @@ export(cor_pmat) export(ggcorrplot) import(ggplot2) +import(ggtext) diff --git a/R/ggcorrplot.R b/R/ggcorrplot.R index 016a82b..dcc8c2a 100644 --- a/R/ggcorrplot.R +++ b/R/ggcorrplot.R @@ -1,5 +1,5 @@ #' Visualization of a correlation matrix using ggplot2 -#' @import ggplot2 +#' @import ggplot2 ggtext #' @description \itemize{ \item ggcorrplot(): A graphical display of a #' correlation matrix using ggplot2. \item cor_pmat(): Compute a correlation #' matrix p-values. } @@ -273,6 +273,8 @@ ggcorrplot <- function(corr, ), axis.text.y = ggplot2::element_text(size = tl.cex) ) + + ggplot2::theme(axis.text.x = ggtext::element_markdown(colour = tl.col), + axis.text.y = ggtext::element_markdown(colour = tl.col))+ ggplot2::coord_fixed() label <- round(x = corr[, "value"], digits = digits)