Learn R Programming

aclhs (version 1.0.1)

aclhs.plot_params: Set parameters for plotting.

Description

Sets various parameters for plotting including plot title, axis labels, plot dimensions and resolution, and whether to add a legend to the plot. By default, a plot will not be created, and the location of where the legend should be placed on the plot should be passed (e.g., "topright").

Usage

aclhs.plot_params(
  file_name,
  plot_title = "",
  xlab = "",
  ylab = "",
  width = 1000,
  height = 1000,
  res = 150,
  legend = NULL
)

Value

A list of the set plotting parameters

Arguments

file_name

The name of the file to store the plot in (should end with '.png')

plot_title

The title of the plot (default is blank)

xlab

The label for the x axis of the plot (default is blank)

ylab

The label for the y axis of the plot (default is blank)

width

The width of the plot (default is 1000)

height

The height of the plot (default is 1000)

res

The resolution of the plot (default is 150)

legend

The location of the legend on the plot (default is NULL)

Examples

Run this code
## Set the parameters
p_params <- aclhs.plot_params(file_name=tempfile(fileext=".png"),
                              plot_title=expression(bold("Sample Distribution")),
                              xlab=expression(bold("X [km]")),
                              ylab=expression(bold("Y [km]")),
                              legend="topright")

## Access one of the the set parameters
p_params$plot_title

Run the code above in your browser using DataLab