theme_neuropsychology: A minimal theme for ggplot2.

Description Usage Arguments Details Author(s) Examples

Description

A minimal theme for ggplot2.

Usage

1
2
3
4
theme_neuropsychology(legend.position="right",
                      legend.text.size=20,
                      axis.title.size=20,
                      axis.text.size=15)

Arguments

legend.position

One of the following: "right", "left", "top" or "bottom".

legend.text.size

The size of the legend text (usually the numbers).

axis.title.size

The size of the legend title.

axis.text.size

The size of the axis titles.

Details

For an even better result, don't forget to change the colour palette and to add a space between the axis title and the axix (see the example below).

Author(s)

Dominique Makowski

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
require(ggplot2)
require(neuropsychology)

df <- personality

ggplot(df, aes(x=Age, y=Negative_Affect, colour=Sex, fill=Sex)) +
  geom_point() +
  geom_smooth(method="lm", fullrange=TRUE) +

  theme_neuropsychology() +

  xlab("\nAge") +
  ylab("Negative Affect\n") +
  scale_fill_brewer(palette="Set1",direction=-1) +
  scale_colour_brewer(palette="Set1",direction=-1)

Example output

Loading required package: tidyverse
Loading tidyverse: ggplot2
Loading tidyverse: tibble
Loading tidyverse: tidyr
Loading tidyverse: readr
Loading tidyverse: purrr
Loading tidyverse: dplyr
Conflicts with tidy packages ---------------------------------------------------
filter(): dplyr, stats
lag():    dplyr, stats
************
Welcome to neuropsychology v0.5.0 (c) Dominique Makowski.
See documentation on https://www.rdocumentation.org/packages/neuropsychology
Do not hesitate to create an issue on https://github.com/neuropsychology/neuropsychology.R/issues with questions, comments, or movie recommendations.
************
Warning messages:
1: Removed 25 rows containing non-finite values (stat_smooth). 
2: Removed 25 rows containing missing values (geom_point). 

neuropsychology documentation built on May 2, 2019, 2:13 p.m.