Skip to content

Commit

Permalink
retain axis limits
Browse files Browse the repository at this point in the history
  • Loading branch information
mfansler committed Feb 14, 2020
1 parent d7cd637 commit 57e90c4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions R/visualization.R
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,8 @@ FeaturePlot <- function(
if (j == length(x = features) && !blend) {
suppressMessages(
expr = plot <- plot +
scale_y_continuous(sec.axis = dup_axis(name = ident)) +
scale_y_continuous(sec.axis = dup_axis(name = ident),
limits = ylims) +
no.right
)
}
Expand Down Expand Up @@ -1208,6 +1209,7 @@ FeaturePlot <- function(
yes = levels(x = data$split)[ii],
no = ''
)),
limits = ylims,
expand = c(0, 0)
) +
labs(
Expand Down Expand Up @@ -1259,15 +1261,18 @@ FeaturePlot <- function(
expr = x +
theme_cowplot() +
ggtitle("") +
scale_y_continuous(sec.axis = dup_axis(name = "")) +
scale_y_continuous(sec.axis = dup_axis(name = ""), limits = ylims) +
no.right
))
}
)
nsplits <- length(x = levels(x = data$split))
idx <- 1
for (i in (length(x = features) * (nsplits - 1) + 1):(length(x = features) * nsplits)) {
plots[[i]] <- suppressMessages(plots[[i]] + scale_y_continuous(sec.axis = dup_axis(name = features[[idx]])) + no.right)
plots[[i]] <- suppressMessages(plots[[i]] +
scale_y_continuous(sec.axis = dup_axis(name = features[[idx]]),
limits = ylims) +
no.right)
idx <- idx + 1
}
idx <- 1
Expand Down

0 comments on commit 57e90c4

Please sign in to comment.