.reg3dnResidual <-
function(lm.out, pdf=FALSE, width=5, height=5, manage.gr=FALSE, ...) {

  # pdf graphics option
  go.pdf <- pdf  # save before base::pdf() would shadow the name
  if (go.pdf) {
    pdf_file <- "RegResiduals.pdf"
    grDevices::pdf(file=pdf_file, width=width, height=height)
  }

  # keep track of the plot in this routine
  plt.i <- 0L
  plt.title  <- character(length=0)

  plt.i <- plt.i + 1L
  plt.title[plt.i] <- "Distribution of Residuals"

  lab_cex <- getOption("lab_cex")
  on.exit(options(lab_cex=lab_cex), add=TRUE)
  options(lab_cex=0.9)

  # frequency distribution of residuals
  .dn.main(lm.out$residuals, 
    fill_hist=getOption("se_fill"),
    col.nrm="gray40", col.gen="gray40", fill.miss=TRUE,
    fill_nrm="transparent", fill_gen="transparent",
    xlab="Residuals", use_plotly=FALSE, quiet=TRUE)

  if (go.pdf) {
    dev.off()
    .showfile(pdf_file, "residuals plot")
  }

  return(invisible(list(i=plt.i, ttl=plt.title)))

}
