Skip to content

pseudo_log_trans() doesn't work when mapped to color or fill #502

@ccsarapas

Description

@ccsarapas

Using scales 1.4.0. Reprex:

library(ggplot2)
library(scales)

p <- ggplot(diamonds) +
  geom_point(aes(x, y, color = price))

p_identity <- p +
  scale_color_viridis_b(
    "identity",
    n.breaks = 6, limits = c(1, NA)
  )

p_log10 <- p +
  scale_color_viridis_b(
    "log10",
    transform = log_trans(base = 10), n.breaks = 6, limits = c(1, NA)
  )

p_pseudo_log10 <- p +
  scale_color_viridis_b(
    "pseudo log10",
    transform = pseudo_log_trans(base = 10), n.breaks = 6, limits = c(1, NA)
  )

cowplot::plot_grid(p_identity, p_log10, p_pseudo_log10, ncol = 3)

Image

The colors scale is transformed correctly for log_trans(). I would expect pseudo_log_trans() to look the same as log_trans(), but instead it matches the untransformed scale.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions