Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log: support symmetric axes #955

Open
davidhodge931 opened this issue Jul 20, 2024 · 2 comments
Open

log: support symmetric axes #955

davidhodge931 opened this issue Jul 20, 2024 · 2 comments

Comments

@davidhodge931
Copy link
Owner

davidhodge931 commented Jul 20, 2024

library(tidyverse)
#> Warning: package 'ggplot2' was built under R version 4.4.1
library(ggblanket)

set_blanket()

pressure |>
  gg_point(
    x = temperature,
    y = pressure,
    y_transform = "log", 
  ) 
#> Warning: Position guide is perpendicular to the intended axis.
#> ℹ Did you mean to specify a different guide `position`?

pressure |>
  gg_point(
    x = temperature,
    y = pressure,
    y_transform = "pseudo_log", 
  ) 

pressure |>
  gg_point(
    x = temperature,
    y = pressure,
    y_transform = transform_log(),
    y_breaks = scales::breaks_log(), #doesn't incorporate data as no only.loose argument
  )
#> Error in transform_log(): could not find function "transform_log"

Created on 2024-07-20 with reprex v2.1.0

@davidhodge931 davidhodge931 changed the title y_transform = "log10" doesn't work as expected support log axes better Jul 20, 2024
@davidhodge931
Copy link
Owner Author

Changed breaks to default to breaks_log

For symmetric axes, just need {scales} to provide an only.loose argument, so this can be added in and able to always work

davidhodge931 added a commit that referenced this issue Jul 20, 2024
@davidhodge931
Copy link
Owner Author

library(tidyverse)
library(ggblanket)
library(palmerpenguins)
  
set_blanket()

penguins |>
  gg_point(
    y = flipper_length_mm,
    x = species,
    y_transform = "log10",
  ) +
  theme(plot.background = element_rect(fill = "grey"))

penguins |>
  gg_point(
    y = flipper_length_mm,
    x = species,
    y_transform = "log10",
    y_symmetric = FALSE,
  ) +
  theme(plot.background = element_rect(fill = "grey"))

Created on 2024-07-21 with reprex v2.1.0

@davidhodge931 davidhodge931 changed the title support log axes better log: support symmetric axes Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant