Skip to content

Commit

Permalink
Update datasets, themes
Browse files Browse the repository at this point in the history
  • Loading branch information
rsh52 committed Oct 15, 2024
1 parent 88410a2 commit 18280ae
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 131 deletions.
40 changes: 16 additions & 24 deletions R/theme_ggswim.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ theme_ggswim <- function(base_size = 12, base_family = "") {
theme_minimal(base_size = base_size, base_family = base_family) +
theme(
# Title and subtitle
plot.title = element_text(size = 18, face = "bold", hjust = 0, margin = margin(b = 10), colour = "#D67A00"),
plot.subtitle = element_text(size = 14, face = "bold", hjust = 0, margin = margin(b = 10), colour = "#FE9000"),
plot.title = element_text(size = 18, face = "bold", hjust = 0, margin = margin(b = 10), colour = "#000000"),
plot.subtitle = element_text(size = 14, face = "bold", hjust = 0, margin = margin(b = 10), colour = "#000000"),

# Caption
plot.caption = element_text(size = 10, hjust = 1),

# Axis text
axis.text = element_text(size = 10, face = "bold", colour = "#0D2C54"),
axis.text = element_text(size = 10, face = "bold", colour = "#000000"),
axis.text.x = element_text(margin = margin(t = 10)),
axis.text.y = element_text(margin = margin(r = 10)),

# Axis titles
axis.title = element_text(size = 12, face = "bold", colour = "#0D2C54"),
axis.title = element_text(size = 12, face = "bold", colour = "#000000"),
axis.title.x = element_text(size = 14, face = "bold", margin = margin(t = 10)),
axis.title.y = element_text(size = 14, face = "bold", margin = margin(r = 10)),

Expand All @@ -60,17 +60,13 @@ theme_ggswim <- function(base_size = 12, base_family = "") {
axis.ticks.length = unit(0.3, "cm"),

# Legend
legend.text = element_text(size = 10, colour = "#0D2C54"),
legend.title = element_text(size = 12, face = "bold", colour = "#D67A00"),
legend.text = element_text(size = 10, colour = "#000000"),
legend.title = element_text(size = 12, face = "bold", colour = "#000000"),

# Axis line
axis.line = element_line(
color = "steelblue",
linewidth = 1,
arrow = arrow(
type = "closed",
length = unit(0.1, "inches"),
)
linewidth = 1
),

# Remove grid lines
Expand All @@ -89,8 +85,8 @@ theme_ggswim_dark <- function(base_size = 12, base_family = "") {
panel.background = element_rect(fill = "#232234", color = NA),

# Title and subtitle
plot.title = element_text(size = 18, face = "bold", hjust = 0, margin = margin(b = 10), colour = "#FE9000"),
plot.subtitle = element_text(size = 14, face = "bold", hjust = 0, margin = margin(b = 10), colour = "#D67A00"),
plot.title = element_text(size = 18, face = "bold", hjust = 0, margin = margin(b = 10), colour = "#F0F0F0"),
plot.subtitle = element_text(size = 14, face = "bold", hjust = 0, margin = margin(b = 10), colour = "#F0F0F0"),

# Caption
plot.caption = element_text(size = 10, hjust = 1, colour = "#F0F0F0"),
Expand All @@ -101,26 +97,22 @@ theme_ggswim_dark <- function(base_size = 12, base_family = "") {
axis.text.y = element_text(margin = margin(r = 10), colour = "#F0F0F0"),

# Axis titles
axis.title = element_text(size = 12, face = "bold", colour = "#FE9000"),
axis.title.x = element_text(size = 14, face = "bold", margin = margin(t = 10), colour = "#FE9000"),
axis.title.y = element_text(size = 14, face = "bold", margin = margin(r = 10), colour = "#FE9000"),
axis.title = element_text(size = 12, face = "bold", colour = "#F0F0F0"),
axis.title.x = element_text(size = 14, face = "bold", margin = margin(t = 10), colour = "#F0F0F0"),
axis.title.y = element_text(size = 14, face = "bold", margin = margin(r = 10), colour = "#F0F0F0"),

# Axis tick marks
axis.ticks = element_line(linewidth = 0.75, colour = "#FE9000"),
axis.ticks = element_line(linewidth = 0.75, colour = "#F0F0F0"),
axis.ticks.length = unit(0.3, "cm"),

# Legend
legend.text = element_text(size = 10, colour = "#F0F0F0"),
legend.title = element_text(size = 12, face = "bold", colour = "#FE9000"),
legend.title = element_text(size = 12, face = "bold", colour = "#F0F0F0"),

# Axis line
axis.line = element_line(
color = "#FE9000", # Orange axis line
linewidth = 1,
arrow = arrow(
type = "closed",
length = unit(0.1, "inches")
)
color = "#F0F0F0", # Orange axis line
linewidth = 1
),

# Remove grid lines
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Using the custom `marker` `aes()` in `geom_swim_marker()` in combination with sp
p +
scale_colour_brewer(name = "Lanes", palette = "Set1") +
labs(title = "My Swimmer Plot") +
xlab("Time Since Infusion (Months)") + ylab("Patient ID") +
xlab("Time Since Initial Infusion (Months)") + ylab("Patient ID") +
theme_ggswim()
```

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ ggplot2 techniques and a last finishing touch with `theme_ggswim()`:
p +
scale_colour_brewer(name = "Lanes", palette = "Set1") +
labs(title = "My Swimmer Plot") +
xlab("Time Since Infusion (Months)") + ylab("Patient ID") +
xlab("Time Since Initial Infusion (Months)") + ylab("Patient ID") +
theme_ggswim()
```

Expand Down
Binary file modified data/infusion_events.rda
Binary file not shown.
Binary file modified man/figures/README-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 18280ae

Please sign in to comment.