From 0de93c225ad90eb111107a8ad2047589e8182ff8 Mon Sep 17 00:00:00 2001 From: tonyelhabr Date: Sun, 21 Jan 2024 15:50:06 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20tonyelha?= =?UTF-8?q?br/soccerplotR@8f7f66646f6ddeb2492359b275a743a7dfdd29f4=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 45 ++++++++++++++++++----- pkgdown.yml | 2 +- reference/figures/README-example-1-1.png | Bin 0 -> 1049588 bytes reference/figures/README-example-2-1.png | Bin 0 -> 177969 bytes search.json | 2 +- 5 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 reference/figures/README-example-1-1.png create mode 100644 reference/figures/README-example-2-1.png diff --git a/index.html b/index.html index 08a5af8..d2d5fb9 100644 --- a/index.html +++ b/index.html @@ -100,7 +100,7 @@

Exampleslibrary(soccerplotR) library(ggplot2) -FONT <- 'Kanit' +FONT <- "Kanit" sysfonts::font_add_google(FONT) showtext::showtext_auto() showtext::showtext_opts(dpi = 300) @@ -131,25 +131,52 @@

Examples label = team_name, fill = team_name ), - color = 'white', + color = "white", family = FONT, size = 10 / .pt, nudge_y = -0.5 ) + - scale_fill_soccer(type = 'primary') + + scale_fill_soccer(type = "primary") + theme_void() + theme( - plot.margin = margin(25, 25, 25, 25, 'pt') + plot.margin = margin(25, 25, 25, 25, "pt") ) + - coord_cartesian(clip = 'off') + + coord_cartesian(clip = "off") + labs( - title = 'A random sample of 45 teams' + title = "A random sample of 45 teams" ) + theme( - plot.title.position = 'plot', - plot.title = element_text(family = FONT, size = 18, hjust = 0.5, vjust = 1) + plot.title.position = "plot", + plot.title = element_text(family = FONT, size = 18, hjust = 0.5) ) -

+

+
+team_names <- soccerplotR::valid_team_names("ENG")
+
+df <- data.frame(
+  team_name = team_names,
+  value = 1:length(team_names)
+)
+
+df$team_name <- factor(df$team_name, levels = df$team_name[order(df$value)])
+
+ggplot(df, aes(y = team_name, x = value)) +
+  geom_col(aes(color = team_name, fill = team_name), width = 0.8) +
+  scale_color_soccer(type = "secondary") +
+  scale_fill_soccer(alpha = 0.8) +
+  theme_minimal() +
+  theme(
+    plot.title.position = "plot",
+    plot.title = element_text(family = FONT, size = 18),
+    axis.text = element_text(family = FONT),
+    panel.grid.major.y = element_blank()
+  ) +
+  labs(
+    x = NULL,
+    y = NULL,
+    title = "English teams in {soccerplotR}"
+  )
+