2.1 Simple Example

As an example, pubtheme turns a ggplot like this

Code
library(tidyverse)
library(pubtheme)

restore.ggplot.defaults()

ggplot(mtcars, 
       aes(x = wt, 
           y = mpg, 
           color = as.factor(cyl))) +
  geom_point(aes(size = mpg)) + 
  labs(title = 'Miles Per Gallon vs Weight', 
       x     = 'Weight', 
       y     = 'Miles Per Gallon',
       color = 'Cylinders', 
       size  = 'MPG') 

into this

Code
dg = mtcars %>% 
  select(wt, mpg, cyl)

g = ggplot(mtcars, 
           aes(x = wt, 
               y = mpg, 
               color = as.factor(cyl)))+
  geom_point(aes(size = mpg))+
  labs(title = 'Miles Per Gallon vs Weight', 
       x     = 'Weight',  
       y     = 'Miles Per Gallon',
       color = 'Cylinders', 
       size  = 'MPG') 

g %>% 
  pub(xlim = c(0, 6),
      ylim = c(0, 40))

[1] 40
[1] 80
[1] 20
[1] 140