themejj: A ggplot theme: simple publication-ready theme

Description Usage Arguments Author(s) Examples

View source: R/themejj.R

Description

A ggplot theme: simple publication-ready theme

Usage

1
2
3
4
5
6
7
themejj(
  base_size = 10,
  base_family = .default_font,
  base_line_size = base_size/30,
  base_rect_size = base_size/30,
  facet = FALSE
)

Arguments

base_size

The base size of the font; defaults to 10 pt

base_family

base font family; defaults to "opensans" loaded via thePshowtext package. Note: you need to have the font isntalled. The package wil try to fetch the font.

base_line_size

base size for line elements

base_rect_size

base size for rect elements

facet

(optional, default is FALSE). If TRUE a rectangle around plotting panel is shown, useful if you use facetting (facet_grid(), facet_wrap().

Author(s)

Jana B. Jarecki

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
see here for more https://github.com/JanaJarecki/themejj/wiki
data(mtcars)
ggplot(mtcars, aes(mpg, wt)) +
  geom_point(size = 2, 
            fill="#83AEB2",
            color="#AEAEB7",
            alpha = .6) +
  geom_smooth(method = lm, alpha = .2, color = "black") +
  labs(title = 'Line Plot', caption = 'Source: mtcars',
      subtitle="Miles Per Gallon and Weight")
# ggsave("../img/lineplot.jpg", w = 100, h = 100, unit = 'mm')
  
data(iris)
ggplot(iris, aes(Sepal.Length, color = Species)) +
  geom_density() +
  scale_color_viridis_d() +
  labs(caption = 'Source: iris',
      subtitle="A subtitle")
data("midwest", package = "ggplot2")
ggplot(midwest, aes(x=area, y=poptotal)) + 
    geom_point(aes(col=state, size=popdensity), alpha = .3) + 
    geom_smooth(method="loess", se=F, color="black") + 
    xlim(c(0, 0.1)) + 
    ylim(c(0, 500000)) + 
    labs(subtitle="Area versus Population", 
         y="Population", 
         x="Area", 
         title="Scatterplot", 
         caption = "Source: midwest") +
    facet_wrap(~state) +
    scale_color_viridis_d() +
    themejj(facet = TRUE)
# see here for more \link[https://github.com/JanaJarecki/themejj/wiki]

JanaJarecki/themejj documentation built on Sept. 5, 2020, 5:50 p.m.