proto_origin: Tour proto for data origin zero mark

View source: R/2_ggproto_visualize.r

proto_originR Documentation

Tour proto for data origin zero mark

Description

Adds a zero mark showing the location of the origin for the central data area.

Usage

proto_origin(
  identity_args = list(color = "grey60", size = 0.5, alpha = 0.9),
  tail_size = 0.05
)

proto_origin1d(identity_args = list(color = "grey60", size = 0.5, alpha = 0.9))

Arguments

identity_args

A list of static, identity arguments passed into the primary geom. For instance, geom_point(size = 2, alpha = .7) becomes identity_args = list(size = 2, alpha = .7). Also passes more foundational arguments such as stat and position, though these have been tested less.

tail_size

How long the origin mark should extended relative to the observations. Defaults to .05, 5% of the projection space.

See Also

Other ggtour proto functions: append_fixed_y(), facet_wrap_tour(), ggtour(), proto_basis(), proto_default(), proto_density(), proto_density2d(), proto_hex(), proto_highlight(), proto_hline0(), proto_point(), proto_text()

Examples

library(spinifex)
dat  <- scale_sd(penguins_na.rm[, 1:4])
clas <- penguins_na.rm$species

## 2D case:
gt_path <- save_history(dat, grand_tour(), max_bases = 5)
ggt <- ggtour(gt_path, dat, angle = .1) +
  proto_point(list(color = clas, shape = clas)) +
  proto_origin() ## `+` in center

animate_plotly(ggt)


## 1D case:
gt_path1d <- save_history(dat, grand_tour(d = 1), max_bases = 5)

ggt <- ggtour(gt_path1d, dat) +
  proto_density(list(fill = clas, color = clas)) +
  proto_origin1d() ## Adds line at 0.

animate_plotly(ggt)


spinifex documentation built on May 29, 2024, 1:23 a.m.