axis_scale: Change Axis Scale: log2, log10 and more

Description Usage Arguments Examples

Description

Change axis scale.

Usage

1
2
3
xscale(.scale, .format = FALSE)

yscale(.scale, .format = FALSE)

Arguments

.scale

axis scale. Allowed values are one of c("none", "log2", "log10", "sqrt", "percent", "dollar", "scientific"); e.g.: .scale="log2".

.format

ogical value. If TRUE, axis tick mark labels will be formatted when .scale = "log2" or "log10".

Examples

1
2
3
4
5
6
7
# Basic scatter plots
data(cars)
p <- ggscatter(cars, x = "speed", y = "dist")
p

# Set log scale
p + yscale("log2", .format = TRUE)

Example output

Loading required package: ggplot2
Loading required package: magrittr

ggpubr documentation built on July 2, 2020, 2:12 a.m.