Learn R Programming

g2r (version 0.1.0)

motif: Style

Description

Customise general style of the chart.

Usage

motif(g2, coord_type = NULL, coord_rotate = NULL, coord_sx = NULL,
  coord_sy = NULL, coord_reflect = NULL, coord_transpose = NULL,
  width = NULL, height = NULL, padding = rep(10, 4),
  bg_fill = NULL, bg_opacity = NULL, bg_fill_opacity = NULL,
  bg_stroke = NULL, bg_stroke_opacity = NULL, bg_line_width = NULL,
  bg_radius = NULL, plot_fill = NULL, plot_fill_opacity = NULL,
  plot_stroke = NULL, plot_stroke_opacity = NULL,
  plot_opacity = NULL, plot_line_width = NULL, plot_radius = NULL,
  fit = TRUE, animate = TRUE, pixel_ratio = NULL, renderer = NULL,
  font = NULL)

Arguments

g2

An object of class g2r as returned by g2r.

coord_type, coord_rotate, coord_sx, coord_sy, coord_reflect, coord_transpose

Customise global coordinates of chart.

width, height

Chart dimensions.

padding

Padding around chart, a vector of length 4 corresponding to top, right, bottom, and left.

bg_fill, bg_opacity, bg_fill_opacity, bg_stroke, bg_stroke_opacity, bg_line_width, bg_radius

Customise background of global chart.

plot_fill, plot_fill_opacity, plot_stroke, plot_stroke_opacity, plot_opacity, plot_line_width, plot_radius

Customise plot background.

fit

Whether to force graph to fit parent element.

animate

Whether to animate the chart.

pixel_ratio

Device pixel ratio, defaults to window.devicePixelRatio.

renderer

Renderer, canvas or svg.

font

Font to use on chart.

Examples

Run this code
# NOT RUN {
g2(cars, asp(speed, dist)) %>% 
  fig_point() %>% 
  motif(plot_fill = "grey")

# }

Run the code above in your browser using DataLab