design_mytheme: design_mytheme

View source: R/design_mytheme.R

design_mythemeR Documentation

design_mytheme

Description

This function modifies a ggplot2 theme based on user-defined parameters for various plot elements. It allows customization of the theme's appearance, including title size, axis size, legend position, and more.

Usage

design_mytheme(
  theme = "light",
  plot_title_size = 2,
  axis_title_size = 2,
  axis_text_size = 12,
  axis_angle = 60,
  hjust = 1,
  legend.position = NULL,
  legend.direction = NULL,
  legend.size = 0.25,
  legend.key.height = 0.5,
  legend.key.width = 0.5,
  legend.size.text = 10,
  legend.box = "horizontal"
)

Arguments

theme

The desired theme for the plot. Options include "light", "bw", "classic", and "classic2". Default is "light".

plot_title_size

The size of the plot title. Default is 2.

axis_title_size

The size of the axis titles. Default is 2.

axis_text_size

The size of the axis tick mark labels. Default is 12.

axis_angle

The angle of rotation for the x-axis tick mark labels. Default is 60.

hjust

horizontal justification

legend.position

The position of the legend in the plot. Options include "none", "left", "right", "bottom", and "top". Default is NULL.

legend.direction

The direction of the legend items. Options include "horizontal" and "vertical". Default is NULL.

legend.size

The size of the legend key. Default is 0.25.

legend.key.height

The height of the legend key. Default is 0.5.

legend.key.width

The width of the legend key. Default is 0.5.

legend.size.text

The size of the legend text labels. Default is 10.

legend.box

The orientation of the legend box. Options include "horizontal" and "vertical". Default is "horizontal".

Value

mytheme

Author(s)

Dongqiang Zeng

Examples

mytheme <- design_mytheme()

IOBR/IOBR documentation built on April 4, 2024, 1:07 a.m.