Browse code

remove ggimage dependency for theme

Bjørn Tore Kopperud authored on 19/01/2022 14:32:58 • GitHub committed on 19/01/2022 14:32:58
Showing 1 changed files

... ...
@@ -119,7 +119,12 @@ theme_tree2_internal <- function(bgcolor="white", fgcolor="black",
119 119
 theme_inset <- function(legend.position =  "none", ...) {
120 120
     list(xlab(NULL),
121 121
          ylab(NULL),
122
-         theme_tree(legend.position =  legend.position, ...),
123
-         ggimage::theme_transparent()
122
+         theme_tree(legend.position = legend.position,
123
+                    function() theme(panel.background = element_rect(fill = "transparent", colour = NA),
124
+                                     plot.background = element_rect(fill = "transparent", colour = NA), 
125
+                                     legend.key = element_rect(fill = "transparent", colour = NA),
126
+                                     legend.background = element_rect(fill = "transparent",colour = NA),
127
+                                     ...)
128
+                    )
124 129
          )
125 130
 }