square_fig: Change the aspect ratio of a plot.

View source: R/square_fig.R

square_figR Documentation

Change the aspect ratio of a plot.

Description

square_fig takes a ggplot object as input and changes its shape to a square by default. To change the plot to different degrees of rectangular shapes, user can specify an aspect ratio different from 1.

Usage

square_fig(p, aspect_ratio = 1)

Arguments

p

A ggplot object.

aspect_ratio

Aspect ratio of the panel, Default = 1, which will make x and y the same length and hence the figure a square. A value > 1 will make y-axis longer than x-axis. A value < 1 will make x-axis longer than y-axis.

Value

A ggplot object of square shape by default or a rectangular shape when user decides not to use 1 as aspect ratio.


cabaceo/shinymod documentation built on Sept. 8, 2023, 12:23 p.m.