Skip to content

Commit

Permalink
color the selected variables with red in the plots
Browse files Browse the repository at this point in the history
  • Loading branch information
Sechidis authored and Sechidis committed Jan 9, 2024
1 parent 79fdf6a commit 21768bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ plot.variable.selections <- function(S, nbcocluster=c(7,7)) {
selections$selected <- factor(selections$selected)

# vectorized input to ggplot2::element_text() will likely be deprecated:
#axis.text.y.color <- ifelse(unique(selections$variable) %in% stable.vars, "red", "black")
axis.text.y.color <- ifelse(unique(selections$variable) %in% stable.vars, "red", "black")

ggplot2::ggplot(data=selections, mapping=ggplot2::aes(x = draw, y = variable)) +
ggplot2::geom_tile(ggplot2::aes(fill = selected)) +
ggplot2::xlab("knockoff repetition") +
ggplot2::ylab("variable (stable selections colored in red)") +
ggplot2::theme(axis.text.x = ggplot2::element_blank(),
#axis.text.y = ggplot2::element_text(colour = axis.text.y.color),
axis.text.y = ggplot2::element_text(colour = axis.text.y.color),
axis.ticks.x = ggplot2::element_blank()) +
ggplot2::scale_fill_manual(values=c("0"="#132B43","1"="#56B1F7"))

Expand Down

0 comments on commit 21768bf

Please sign in to comment.