Skip to content

Instantly share code, notes, and snippets.

@HorridTom
Created April 22, 2023 17:19
Show Gist options
  • Save HorridTom/43085686f27a5f50a87bb68278382317 to your computer and use it in GitHub Desktop.
Save HorridTom/43085686f27a5f50a87bb68278382317 to your computer and use it in GitHub Desktop.
Example of modifying x-axis labels on autospc plot
library(tidyverse)
library(lubridate)
library(autospc)
set.seed(20230422L)
df <- tibble(x = seq(from = as.Date("2023-01-01"),
to = as.Date("2023-01-31"),
by = 1L),
y = rpois(31L, lambda = 20L))
my_spc_plot <- plot_auto_SPC(df, chartType = "C")
my_spc_plot
my_spc_plot +
scale_x_date(date_breaks = "1 week")
my_spc_plot +
scale_x_date(date_breaks = "1 week") +
theme(axis.text.x = element_text(angle = 90))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment