From 9b94486b12779e4e568e7f65e2c9084a9dcc4569 Mon Sep 17 00:00:00 2001 From: Altair Wei Date: Thu, 28 Mar 2024 03:17:27 +0800 Subject: [PATCH] fix: fix order and layout of strips when grouping (#108, by @altairwei) --- R/plot.euler.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/plot.euler.R b/R/plot.euler.R index 23592d7..7f9b8aa 100644 --- a/R/plot.euler.R +++ b/R/plot.euler.R @@ -546,7 +546,7 @@ plot.euler <- function(x, name = "strip.top.vp", layout = grid::grid.layout(nrow = 1, ncol = layout[2])) - lvls <- levels(strips$groups[[1]]) + lvls <- levels(strips$groups[[ names(layout)[[2]] ]]) n_lvls <- length(lvls) step <- 1/n_lvls @@ -567,7 +567,7 @@ plot.euler <- function(x, name = "strip.left.vp", layout = grid::grid.layout(nrow = layout[1], ncol = 1)) - lvls <- levels(strips$groups[[2]]) + lvls <- rev(levels(strips$groups[[ names(layout)[[1]] ]])) n_lvls <- length(lvls) step <- 1/n_lvls