Skip to content

Commit

Permalink
Plot dendrograms with y-axis in percent
Browse files Browse the repository at this point in the history
- Plot dendrograms with y-axis in percent
- Change y-axis to "Fraction of Regularization"
  • Loading branch information
michaelweylandt committed Dec 19, 2018
1 parent 5b1024d commit 190b13a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions R/plot_carp.R
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,11 @@ carp_dendro_plot <- function(x,
as.dendrogram(x) %>%
set("branches_lwd", dend.branch.width) %>%
set("labels_cex", dend.labels.cex) %>%
plot(ylab = "Amount of Regularization",
cex.lab = dend.ylab.cex,
plot(ylab = "Fraction of Regularization",
cex.lab = dend.ylab.cex, yaxt = "n",
...)

axis(2, at = c(0, 0.25, 0.5, 0.75, 1), labels = c("0%", "25%", "50%", "75%", "100%"), las=2)
if(show_clusters){

if(has_percent){
Expand Down
5 changes: 4 additions & 1 deletion R/plot_cbass.R
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,10 @@ cbass_dendro_plot <- function(x,
as.dendrogram(x, type = type) %>%
set("branches_lwd", dend.branch.width) %>%
set("labels_cex", dend.labels.cex) %>%
plot(ylab = "Amount of Regularization", cex.lab = dend.ylab.cex, ...)
plot(ylab = "Fraction of Regularization",
cex.lab = dend.ylab.cex, yaxt = "n", ...)

axis(2, at = c(0, 0.25, 0.5, 0.75, 1), labels = c("0%", "25%", "50%", "75%", "100%"), las=2)

if(show_clusters){
labels <- get_cluster_labels(x, k.row = k.row, k.col = k.col, percent = percent, type = type)
Expand Down

0 comments on commit 190b13a

Please sign in to comment.