The majority of the approximately 1800 palm tree species are either erect and non-climbing, characterized by tall, slender stems with much greater height than diameter, or non-erect and climbing, with wider stems relative to their height. Very few species fall outside these two dominant growth forms.
#TidyTuesday
{ggblend}
Scatter-plot
Author
Aditya Dahiya
Published
March 22, 2025
About the Data
The dataset for this week’s exploration of Palm Trees is sourced from the PalmTraits 1.0 database, a comprehensive global compilation of functional traits for palms (Arecaceae), a plant family pivotal in tropical and subtropical ecosystems. Accessible via the palmtrees R package developed by Emil Hvitfeldt, this dataset was curated by Lydia Gibson for TidyTuesday. It includes detailed taxonomic information such as species names (spec_name), genus (acc_genus), and subfamily (palm_subfamily), alongside functional traits like growth habits (e.g., climbing, acaulescent, erect), stem characteristics (e.g., max_stem_height_m, stem_armed), leaf dimensions (e.g., max__blade__length_m), and fruit properties (e.g., average_fruit_length_cm, main_fruit_colors).
Figure 1: A scatterplot showing maximum stem diameter (cm) on the X-axis and maximum stem diameter (m) on the Y-axis. The colours of dots refer to the stem-erectness and shape of dots refer to climbing habit. An important technique is the use of blending of colours using {ggblend} to ensure that near the origin of the graph, the overlapping points don’t lead to a loss of visual pattern. The two groups of palm trees’ species emerge which is distinctly visible.
How I made this graphic?
Loading required libraries
Code
# Data Import and Wrangling Toolslibrary(tidyverse) # All things tidy# Final plot toolslibrary(scales) # Nice Scales for ggplot2library(fontawesome) # Icons display in ggplot2library(ggtext) # Markdown text support for ggplot2library(showtext) # Display fonts in ggplot2library(colorspace) # Lighten and Darken colourspalmtrees <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-03-18/palmtrees.csv')
Visualization Parameters
Code
# Font for titlesfont_add_google("Belleza",family ="title_font") # Font for the captionfont_add_google("Saira Extra Condensed",family ="caption_font") # Font for plot textfont_add_google("Cuprum",family ="body_font") showtext_auto()mypal <- paletteer::paletteer_d("ltc::trio3")# cols4all::c4a_gui()# A base Colourbg_col <-"white"seecolor::print_color(bg_col)# Colour for highlighted texttext_hil <- mypal[3]seecolor::print_color(text_hil)# Colour for the texttext_col <- colorspace::darken("#009E73", 0.5)seecolor::print_color(text_col)line_col <-"grey30"# Define Base Text Sizebts <-120# Caption stuff for the plotsysfonts::font_add(family ="Font Awesome 6 Brands",regular = here::here("docs", "Font Awesome 6 Brands-Regular-400.otf"))github <-""github_username <-"aditya-dahiya"xtwitter <-""xtwitter_username <-"@adityadahiyaias"social_caption_1 <- glue::glue("<span style='font-family:\"Font Awesome 6 Brands\";'>{github};</span> <span style='color: {text_hil}'>{github_username} </span>")social_caption_2 <- glue::glue("<span style='font-family:\"Font Awesome 6 Brands\";'>{xtwitter};</span> <span style='color: {text_hil}'>{xtwitter_username}</span>")plot_caption <-paste0("**Data:** Emil Hvitfeldt's {palmtrees}", " | **Code:** ", social_caption_1, " | **Graphics:** ", social_caption_2 )rm(github, github_username, xtwitter, xtwitter_username, social_caption_1, social_caption_2)# Add text to plot-------------------------------------------------plot_title <-"Palm Trees' Species: Skyward or Sprawling"plot_subtitle <-"The majority of the approximately 1800 palm tree species are either erect and non-climbing, characterized by tall, slender stems with much greater height than diameter, or non-erect and climbing, with wider stems relative to their height. Very few species fall outside these two dominant growth forms."# str_view(plot_subtitle)
# Saving a thumbnaillibrary(magick)# Saving a thumbnail for the webpageimage_read(here::here("data_vizs", "tidy_palm_trees.png")) |>image_resize(geometry ="x400") |>image_write( here::here("data_vizs", "thumbnails", "tidy_palm_trees.png" ) )
Session Info
Code
# Data Import and Wrangling Toolslibrary(tidyverse) # All things tidy# Final plot toolslibrary(scales) # Nice Scales for ggplot2library(fontawesome) # Icons display in ggplot2library(ggtext) # Markdown text support for ggplot2library(showtext) # Display fonts in ggplot2library(colorspace) # Lighten and Darken colourssessioninfo::session_info()$packages |>as_tibble() |>select(package, version = loadedversion, date, source) |>arrange(package) |> janitor::clean_names(case ="title" ) |> gt::gt() |> gt::opt_interactive(use_search =TRUE ) |> gtExtras::gt_theme_espn()
Table 1: R Packages and their versions used in the creation of this page and graphics