plot_age: Plotting pretty age images

View source: R/plot_images.R

plot_ageR Documentation

Plotting pretty age images

Description

A function to produce a plot of the stellar age image produced by build_datacube() with associated colour bar and labels.

Usage

plot_age(
  age_image,
  fig = c(0, 1, 0, 1),
  new = F,
  units = expression("Age, Gyr"),
  main = "",
  radii = NA,
  na.color = "white",
  zlim = NA,
  legend = T,
  titleshift = -4,
  labN = 5,
  radii_col = "red",
  ...
)

Arguments

age_image

Numeric array containing the age image

fig

Numeric array of length 4 describing the boundary of the image

new

Boolean. Should the image be added to the existing plot? Default is FALSE.

units

String describing the units of the values contained in the image.

main

Image title, default "".

radii

list - containing a, b, and ang (if wishing to plot half-mass radii ellipse).

na.color

String. Colour given to NA values in the image.

zlim

Numeric array of length 2. Describing the numeric range of colours in the image. Default is NA, in which the range will be described by the minimum and maximum values in the image.

legend

Boolean to determine if the colour bar axis should be printed at the bottom of the image. Default is T.

titleshift

Numeric. Describes the distance between the colour bar and the units. Default is -4.

labN

Numeric. Describes the minimum number of numeric labels added to the colour bar. Default is 5.

radii_col

String. Describing the colour of the ellipse drawn if radii list is specified. Default is "red".

...

Further variables passed to magimage. See magimage for further details.

Value

Returns an image to the plotting window of the input build_datacube image.

Examples

ss_pd_gadget = system.file("extdata", "SimSpin_example_Gadget",
package = "SimSpin")
ss_gadget = make_simspin_file(ss_pd_gadget, write_to_file = FALSE)
cube = build_datacube(simspin_file = ss_gadget,
                      telescope = telescope(type="SAMI"),
                      observing_strategy = observing_strategy(),
                      method = "velocity")
plot_age(cube$raw_images$age_image)

kateharborne/SimSpin documentation built on April 28, 2024, 2 p.m.