daattali / ggExtra

📊 Add marginal histograms to ggplot2, and more ggplot2 enhancements
http://daattali.com/shiny/ggExtra-ggMarginal-demo/
Other
383 stars 45 forks source link

ggMarginal should carry theme of title through #46

Closed crew102 closed 7 years ago

crew102 commented 7 years ago

Right now ggMarginal only carries the color and font face of the scatter plot's title through to the final plot. The text grob that we use for a title in the final plot is created here:

    title <- grid::textGrob(
      pb$plot$labels$title,
      gp = grid::gpar(col = pb$plot$theme$plot.title$colour,
                      fontsize = 16, fontface = pb$plot$theme$plot.title$face)
    )

It's easy to pull out the ggplot2 titleGrob that contains all of the theme elements desired by the user, and drop that grob in instead of using grid::textGrob. I will include this in the next PR.

daattali commented 7 years ago

Thank you, this PR is going to be loved by many!