davidhodge931 / ggblanket

Simplify ggplot2 visualisation
https://davidhodge931.github.io/ggblanket/
Other
149 stars 8 forks source link

gg_*: remove axis ticks for discrete x/y scales #937

Closed davidhodge931 closed 3 weeks ago

davidhodge931 commented 3 weeks ago
library(ggplot2)
library(dplyr)
library(palmerpenguins)

set_blanket()

p <- penguins |>
  gg_bar(
    y = species,
    width = 0.75,
  )

p

#if y_orientation & y_scale_type == "discrete"
p + theme(axis.ticks.y = element_blank())

p <- penguins |>
  gg_bar(
    x = species,
    width = 0.75,
  )

p

#if x_orientation & x_scale_type == "discrete"
p + theme(axis.ticks.x = element_blank())
davidhodge931 commented 3 weeks ago

Sorted :)