Skip to content

Commit

Permalink
add hex logo
Browse files Browse the repository at this point in the history
  • Loading branch information
lschneiderbauer committed Dec 29, 2024
1 parent 3952618 commit b0e6fa6
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ knitr::opts_chunk$set(
)
```

# fCWTr
# fCWTr <a href="https://lschneiderbauer.github.io/fcwtr/"><img src="man/figures/logo.png" align="right" height="139" alt="fCWTr website" /></a>

<!-- badges: start -->

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# fCWTr
# fCWTr <a href="https://lschneiderbauer.github.io/fcwtr/"><img src="man/figures/logo.png" align="right" height="139" alt="fCWTr website" /></a>

<!-- badges: start -->

Expand Down
47 changes: 47 additions & 0 deletions data-raw/hex-logo.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
library(hexSticker)
library(tidyverse)
library(showtext)

## Loading Google fonts (http://www.google.com/fonts)
font_add_google("Tiny5", db_cache = FALSE)
font_add_google("Micro 5", db_cache = FALSE)


morlet <- function(x, sigma) {
exp(-x^2) * sin(2 * pi * x * sigma)
}

p <-
tibble(x = seq(-2.5, 2.5, by = 0.025)) |>
mutate(
y = morlet(x, 1),
c = abs(x)
) |>
ggplot(aes(x = x, y = y)) +
# geom_line(linewidth = 1.5) +
geom_point(size = 0.8, shape = "square") +
# scale_color_viridis() +
theme_void() +
theme(
legend.position = "none"
)
p

# hexSticker conventions (by experiment)
# (x,y) = (1,1) seems to be the center of hex
# (x,y) = (0,0) is left bottom corner

sticker(
p,
package = "",
s_x = 1, s_y = 1,
s_width = 2, s_height = 1.6,
h_fill = "white",
h_color = "black",
url = "fCWTr",
u_size = 26,
u_family = "Micro 5",
u_x = 1.15,
u_y = 0.23,
filename = "inst/figures/hex-logo.png"
) |> plot()
Binary file added inst/figures/hex-logo.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 added 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 b0e6fa6

Please sign in to comment.