briandk / granovaGG

Bob Pruzek and Jim Helmreich's implementation of Elemental Graphics for Analysis of Variance
Other
15 stars 4 forks source link

granovagg.contr doesn't let users set x axis labels #68

Open briandk opened 13 years ago

briandk commented 13 years ago

Again, we can discuss this, but the default behavior is contained within a function that gets called by an apply call. The reason for that behavior is so we can automate and standardize pasting contrast names into the x-axis label:

  ComposeContrastPlot <- function(plot.data, index) {    
    p <- ggplot()
    p <- p + MeanResponse(plot.data[[index]]$raw.data$y.values)
    p <- p + JitteredResponsesByContrast(plot.data[[index]]$raw.data)
    p <- p + EffectsOfContrasts(plot.data[[index]]$summary.data)
    p <- p + ConnectEffectMeans(plot.data[[index]]$summary.data)
    p <- p + Theme(plot.theme)
    p <- p + ContrastPlotTitle(ctr, index)
    p <- p + ContrastPlotXLabel(ctr, index)
    p <- p + ContrastPlotYLabel()

    return(p)
  }

and

  ContrastPlotXLabel <- function(ctr, index) {
    return(
        xlab(paste(GetContrastName(ctr$contrast.matrix, index)))
    )
  }
briandk commented 12 years ago

I'm OK deferring this feature for a later release, so I'm removing it from the version 1.1 milestone.