Skip to content

Commit

Permalink
make the censoring windows non-symmetric in the logo
Browse files Browse the repository at this point in the history
  • Loading branch information
seabbs committed Sep 2, 2024
1 parent 30a80c1 commit e49e744
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions inst/make_hexsticker.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ data$observed <- sample(
)

# Generate random error bar widths for each event
data$primary_error <- runif(n_events, 0.2, 0.8)
data$secondary_error <- runif(n_events, 0.2, 0.8)
data$primary_error_left <- runif(n_events, 0.2, 0.8)
data$primary_error_right <- runif(n_events, 0.2, 0.8)
data$secondary_error_left <- runif(n_events, 0.2, 0.8)
data$secondary_error_right <- runif(n_events, 0.2, 0.8)

# Determine which events cross the observation line
observation_time <- 10
Expand All @@ -41,11 +43,11 @@ plot <- ggplot(data, aes(y = id)) +
geom_point(aes(x = primary), color = "#4682B4", size = 1) +
# Add secondary events
geom_point(aes(x = secondary), color = "#20B2AA", size = 1) +
# Add uncertainty brackets with varying widths
geom_errorbarh(aes(xmin = primary - primary_error, xmax = primary + primary_error), height = 0.6, color = "#4682B4", size = 0.9) +
geom_errorbarh(aes(xmin = secondary - secondary_error, xmax = secondary + secondary_error), height = 0.6, color = "#20B2AA", size = 0.9) +
# Add uncertainty brackets with non-symmetric widths
geom_errorbarh(aes(xmin = primary - primary_error_left, xmax = primary + primary_error_right), height = 0.6, color = "#4682B4", size = 0.9) +
geom_errorbarh(aes(xmin = secondary - secondary_error_left, xmax = secondary + secondary_error_right), height = 0.6, color = "#20B2AA", size = 0.9) +
# Add observation time line
geom_vline(xintercept = observation_time, linetype = "dashed", color = "#999999", size = 0.3) +
geom_vline(xintercept = observation_time, linetype = "dashed", color = "#999999", linewidth = 0.3) +
# Customize the plot
scale_x_continuous(limits = c(0, 15)) +
scale_y_continuous(limits = c(0.5, n_events - 0.5)) + # Adjusted for removed event
Expand Down
Binary file modified man/figures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e49e744

Please sign in to comment.