Package 'add2ggplot'

Title: Add to 'ggplot2'
Description: Create 'ggplot2' themes and color palettes.
Authors: Jiaxiang Li [aut, cre] , Nakagawara Ryo [aut]
Maintainer: Jiaxiang Li <[email protected]>
License: MIT + file LICENSE
Version: 0.3.0
Built: 2024-10-27 04:19:42 UTC
Source: https://github.com/jiaxiangbu/add2ggplot

Help Index


Get image width and height

Description

Get image width and height

Usage

get_width_height(img)

Arguments

img

The path of image


The chosen color in grey

Description

The chosen color in grey

Usage

grey_one

Format

An object of class character of length 1.


The chosen color in grey

Description

The chosen color in grey

Usage

grey_two

Format

An object of class character of length 1.


Use a palette with 24 colors

Description

more_colors helps users to build a more robust palette serving ggplot objects.

Usage

more_colors(n = 24)

Arguments

n

the max number of color you choose

Value

The vector of the colors you choose

Author(s)

Jiaxiang Li

Examples

more_colors(n = 12)
more_colors(n = 24)
more_colors(n = 36)

The chosen color in red

Description

The chosen color in red

Usage

red_one

Format

An object of class character of length 1.


The chosen color in red

Description

The chosen color in red

Usage

red_two

Format

An object of class character of length 1.


Another classic theme

Description

# Inspired by https://www.datacamp.com//courses/intermediate-data-visualization-with-ggplot2

Usage

theme_classic2()

Value

ggplot object.

Examples

datasets::mtcars %>%
  ggplot2::ggplot(ggplot2::aes(mpg, disp)) +
  ggplot2::geom_point() +
  theme_classic2()

Use Du Bois's theme

Description

theme_du_bois is one of ggplot themes for ploting.

Usage

theme_du_bois(font_name = "")

Arguments

font_name

A Character.

Details

The function I developed originates from this GitHub Repository by the statistician Matthew A. He reproduces the sort of images originated from W.E.B. Du Bois.

Value

The function to use + in the ggplot workflow.

Author(s)

Jiaxiang Li

Examples

datasets::mtcars %>%
  ggplot2::ggplot(ggplot2::aes(mpg, disp)) +
  ggplot2::geom_point() +
  theme_du_bois()

Use the ggplot theme in grey and red

Description

Use the ggplot theme in grey and red

Usage

theme_grey_and_red()

Value

The function to use + in the ggplot workflow.

Author(s)

Jiaxiang Li

Examples

datasets::mtcars %>%
  ggplot2::ggplot(ggplot2::aes(mpg, disp)) +
  ggplot2::geom_point() +
  theme_grey_and_red()

One ggplot theme

Description

One ggplot theme

Usage

theme_ilo()

Value

The function to use + in the ggplot workflow.

Examples

datasets::mtcars %>%
  ggplot2::ggplot(ggplot2::aes(mpg, disp)) +
  ggplot2::geom_point() +
  theme_ilo()

A ggplot theme with a white background.

Description

A ggplot theme with a white background.

Usage

theme_white()

Value

The function to use + in the ggplot workflow.

Examples

datasets::mtcars %>%
  ggplot2::ggplot(ggplot2::aes(mpg, disp)) +
  ggplot2::geom_point() +
  theme_white()

The chosen color in white

Description

The chosen color in white

Usage

white_one

Format

An object of class character of length 1.