Commit 7c7f53d7eb0ed95d163a151dee2a1409ae1e5909
1 parent
e2126d2c
fix algorithm names for BC grid
Showing
1 changed file
with
7 additions
and
1 deletions
share/openbr/plotting/plot_utils.R
| @@ -9,7 +9,13 @@ library("grid") | @@ -9,7 +9,13 @@ library("grid") | ||
| 9 | 9 | ||
| 10 | # Code to format FAR values | 10 | # Code to format FAR values |
| 11 | far_names <- list('0.001'="FAR = 0.1%", '0.01'="FAR = 1%") | 11 | far_names <- list('0.001'="FAR = 0.1%", '0.01'="FAR = 1%") |
| 12 | -far_labeller <- function(variable,value) { return(far_names[as.character(value)]) } | 12 | +far_labeller <- function(variable,value) { |
| 13 | + if (as.character(value) %in% names(far_names)) { | ||
| 14 | + return(far_names[as.character(value)]) | ||
| 15 | + } else { | ||
| 16 | + return(as.character(value)) | ||
| 17 | + } | ||
| 18 | +} | ||
| 13 | 19 | ||
| 14 | getScale <- function(mode, title, vals) { | 20 | getScale <- function(mode, title, vals) { |
| 15 | if (vals > 12) return(do.call(paste("scale", mode, "discrete", sep="_"), list(title))) | 21 | if (vals > 12) return(do.call(paste("scale", mode, "discrete", sep="_"), list(title))) |