From d4e42a035e0fc18a6e11a5cbf91b46258fd42d49 Mon Sep 17 00:00:00 2001 From: Ben Klein Date: Wed, 22 Jul 2015 11:52:53 -0400 Subject: [PATCH] fix barchart labelling bug --- share/openbr/plotting/plot_utils.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/openbr/plotting/plot_utils.R b/share/openbr/plotting/plot_utils.R index ea19d71..c37324d 100644 --- a/share/openbr/plotting/plot_utils.R +++ b/share/openbr/plotting/plot_utils.R @@ -124,9 +124,9 @@ plotBC <- function(bcData=NULL) { plotString <- paste("qplot(factor(", factor, ")", if(smooth) ", Y" else "", ", data=bcData, ", if(smooth) "geom=\"boxplot\"" else "geom=\"bar\", position=\"dodge\", weight=Y", sep="") p <- eval(parse(text=paste(plotString, if(majorSize > 1) paste(", fill=factor(", majorHeader, ")", sep="") else "", ", xlab=\"False Accept Rate\", ylab=\"True Accept Rate\") + theme_minimal()", sep=""))) if(majorSize > 1) p <- p + getScale("fill", majorHeader, majorSize) - if(minorSize > 1) p <- p + facet_grid(facets=as.formula(paste(minorHeader, "~", "X"))) else p <- p + facet_grid(. ~ X, labeller=far_labeller) + if(minorSize > 1) p <- p + facet_grid(facets=as.formula(paste(minorHeader, "~", "X")), labeller=far_labeller) else p <- p + facet_grid(. ~ X, labeller=far_labeller) p <- p + scale_y_continuous(labels=percent) + theme(legend.position="none", axis.text.x=element_text(angle=-90, hjust=0)) - if(!smooth) p <- p + geom_text(data=bcData, aes(label=bcData$Y, y=0.05)) + if(!smooth) p <- p + geom_text(data=bcData, aes(label=Y, y=0.05)) return(p) } -- libgit2 0.21.4