if(interactive()) {
dsamp <- dplyr::sample_n(diamonds, 100)
if (FALSE) {
# press `R`, then rotate with a minor tweak,
# Issues:
# 1: Points are displayed outside the window
# 2: Always in a line shape
l_ggplot(dsamp, aes(x = carat, y = price,
z = depth, colour = color)) +
geom_point()}
# set scales
l_ggplot(dsamp, aes(x = carat, y =price,
z = depth, colour = color)) +
geom_point() +
scale_multi()
# customized `trans`
logp1_base10_trans <- scales::trans_new(
name = "logp",
trans = function(x) log(x + 1, base = 10),
inverse = function(x) 10**x - 1,
breaks = scales::log_breaks())
l_ggplot(dsamp, aes(x = carat, y = price,
z = depth, colour = color)) +
geom_point() +
scale_multi(trans = logp1_base10_trans)
}
Run the code above in your browser using DataLab