Skip to content

Commit

Permalink
Fix #318 legend in demography and pk parameter vpcs
Browse files Browse the repository at this point in the history
* Fix #318 legend in demography and pk parameter vpcs

* Remove word "Population" from legend title
  • Loading branch information
pchelle authored Sep 17, 2020
1 parent c7f3780 commit 974b5fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions R/utilities-calculate-pk-parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ plotPopulationPKParameters <- function(structureSets,
# Get the table for reference population
referenceData <- data.frame(
x = c(-Inf, Inf),
"Population" = paste("Simulated", AggregationConfiguration$names$middle, AggregationConfiguration$names$range, "for", referencePopulationName)
"Population" = paste("Simulated", AggregationConfiguration$names$middle, "and", AggregationConfiguration$names$range, "of", referencePopulationName)
)
referenceData[, c("ymin", "median", "ymax")] <- pkParameterTable[referencePopulationName, c(3, 5, 7)]

Expand All @@ -286,7 +286,7 @@ plotPopulationPKParameters <- function(structureSets,

for (populationName in populationNames[!populationNames %in% referencePopulationName]) {
comparisonData <- aggregatedData[aggregatedData$Population %in% populationName, ]
comparisonData$Population <- paste("Simulated", AggregationConfiguration$names$middle, AggregationConfiguration$names$range, "for", comparisonData$Population)
comparisonData$Population <- paste("Simulated", AggregationConfiguration$names$middle, "and", AggregationConfiguration$names$range)

comparisonVpcPlot <- vpcParameterPlot(
data = comparisonData,
Expand All @@ -305,7 +305,7 @@ plotPopulationPKParameters <- function(structureSets,
# Regular range plots not associated to workflow type
for (populationName in populationNames) {
vpcData <- aggregatedData[aggregatedData$Population %in% populationName, ]
vpcData$Population <- paste("Simulated", AggregationConfiguration$names$middle, AggregationConfiguration$names$range, "for", vpcData$Population)
vpcData$Population <- paste("Simulated", AggregationConfiguration$names$middle, "and", AggregationConfiguration$names$range)
vpcPlot <- vpcParameterPlot(
data = vpcData,
metaData = vpcMetaData,
Expand Down Expand Up @@ -462,6 +462,7 @@ vpcParameterPlot <- function(data,
size = 1
)
vpcPlot <- tlf::setLegendPosition(plotObject = vpcPlot, position = reDefaultLegendPosition)
vpcPlot <- vpcPlot + ggplot2::theme(legend.title = ggplot2::element_blank())

return(vpcPlot)
}
Expand Down
6 changes: 3 additions & 3 deletions R/utilities-demography.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ plotDemographyParameters <- function(structureSets,
ymin = rep(AggregationConfiguration$functions$ymin(referenceData[, parameterName]), 2),
median = rep(AggregationConfiguration$functions$middle(referenceData[, parameterName]), 2),
ymax = rep(AggregationConfiguration$functions$ymax(referenceData[, parameterName]), 2),
"Population" = paste("Simulated ", AggregationConfiguration$names$middle, AggregationConfiguration$names$range, "for", referencePopulationName)
"Population" = paste("Simulated", AggregationConfiguration$names$middle, "and", AggregationConfiguration$names$range, "of", referencePopulationName)
)

referenceVpcPlot <- vpcParameterPlot(
Expand All @@ -139,7 +139,7 @@ plotDemographyParameters <- function(structureSets,

for (populationName in populationNames[!populationNames %in% referencePopulationName]) {
comparisonData <- aggregatedData[aggregatedData$Population %in% populationName, ]
comparisonData$Population <- paste("Simulated ", AggregationConfiguration$names$middle, AggregationConfiguration$names$range, "for", comparisonData$Population)
comparisonData$Population <- paste("Simulated", AggregationConfiguration$names$middle, "and", AggregationConfiguration$names$range)

comparisonVpcPlot <- vpcParameterPlot(
data = comparisonData,
Expand All @@ -157,7 +157,7 @@ plotDemographyParameters <- function(structureSets,

for (populationName in populationNames) {
vpcData <- aggregatedData[aggregatedData$Population %in% populationName, ]
vpcData$Population <- paste("Simulated ", AggregationConfiguration$names$middle, AggregationConfiguration$names$range, "for", vpcData$Population)
vpcData$Population <- paste("Simulated", AggregationConfiguration$names$middle, "and", AggregationConfiguration$names$range)

vpcPlot <- vpcParameterPlot(
data = vpcData,
Expand Down

0 comments on commit 974b5fe

Please sign in to comment.