Configure the axes.

Customise the legend.

axis_x(g, ...)

axis_y(g, ...)

axis_asps(g, asps, ...)

axis_hide(g)

legend_color(g, ...)

legend_size(g, ...)

legend_asps(g, asps, ...)

Arguments

g

An object of class g2r or g2Proxy as returned by g2() or g2_proxy().

...

Options to pass to the legend, pass FALSE to hide the axis. Visit the official documentation for the full list of options.

asps

Aspect (column names) to change the legend.

Functions

  • axis_x: Customise the x axis.

  • axis_y: Customise the y axis.

  • axis_asps: Customise the axis by aspects (column names).

  • axis_hide: Hide all axis.

  • legend_color: Customise the x axis.

  • legend_size: Customise the y axis.

  • legend_asps: Customise the axis by aspects (column names).

Examples

g <- g2(cars, asp(speed, dist)) %>%
  fig_point()

# hide axis
g %>% axis_x(FALSE)

# same as above
g %>% axis_asps("speed", FALSE)

# change position
g %>% axis_x(position = "top")
g <- g2(mtcars, asp(mpg, qsec, color = gear)) %>%
  fig_point()

g %>% legend_color(position = "top")
g %>% legend_color(FALSE)