diff --git a/R/messages.R b/R/messages.R index ae259216..d85bf693 100644 --- a/R/messages.R +++ b/R/messages.R @@ -296,6 +296,13 @@ messages <- list( paste0(highlight(unique(values)), collapse = "', '"), "'." ) }, + warningLogScaleIssue = function(output) { + paste0( + "Plot scale is logarithmic, however all values from simulated output '", + highlight(output), "' were 0." + ) + }, + #----- Info messages ---- runStarting = function(runName, subRun = NULL) { if (is.null(subRun)) { diff --git a/R/qualification-comparison-time-profile.R b/R/qualification-comparison-time-profile.R index f2b62196..dde3edd4 100644 --- a/R/qualification-comparison-time-profile.R +++ b/R/qualification-comparison-time-profile.R @@ -124,7 +124,14 @@ addOutputToComparisonTimeProfile <- function(outputMapping, simulationDuration, molWeight = molWeight ) simulatedValues <- simulatedValues[selectedTimeValues] - + logScaleIssue <- all(simulatedValues == 0, isIncluded(axesProperties$y$scale, "log")) + if(logScaleIssue){ + warning(messages$warningLogScaleIssue(outputMapping$Output), call. = FALSE) + # Set the first value to 1 to avoid log scale issue + # Since this only affect one value, no line will plotted + simulatedValues[1] <- 1 + } + # Add simulated values to plot plotObject <- tlf::addLine( x = simulatedTime,