Skip to content

marquee examples do not work for coloured text #97

Closed

Description

@njtierney

Following the example at https://marquee.r-lib.org/reference/element_marquee.html

I cannot replicate this - is this the expected output? I was expecting a red label.

library(marquee)

library(ggplot2)
p <- ggplot(mtcars) +
    geom_point(aes(mpg, disp)) +
    labs(title = "A {.red *marquee*} title\n* Look at this bullet list\n\n* great, huh?") +
    theme_gray(base_size = 6) +
    theme(title = element_marquee())

p

plot(p)

Created on 2025-10-24 with reprex v2.1.1

Session info

sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.5.1 (2025-06-13)
#>  os       macOS Tahoe 26.0.1
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       Australia/Hobart
#>  date     2025-10-24
#>  pandoc   3.6.3 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/aarch64/ (via rmarkdown)
#>  quarto   1.7.31 @ /usr/local/bin/quarto
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package      * version date (UTC) lib source
#>  cli            3.6.5   2025-04-23 [1] CRAN (R 4.5.0)
#>  curl           7.0.0   2025-08-19 [1] CRAN (R 4.5.0)
#>  digest         0.6.37  2024-08-19 [1] CRAN (R 4.5.0)
#>  dplyr          1.1.4   2023-11-17 [1] CRAN (R 4.5.0)
#>  evaluate       1.0.5   2025-08-27 [1] CRAN (R 4.5.0)
#>  farver         2.1.2   2024-05-13 [1] CRAN (R 4.5.0)
#>  fastmap        1.2.0   2024-05-15 [1] CRAN (R 4.5.0)
#>  fs             1.6.6   2025-04-12 [1] CRAN (R 4.5.0)
#>  generics       0.1.4   2025-05-09 [1] CRAN (R 4.5.0)
#>  ggplot2      * 4.0.0   2025-09-11 [1] CRAN (R 4.5.0)
#>  glue           1.8.0   2024-09-30 [1] CRAN (R 4.5.0)
#>  gtable         0.3.6   2024-10-25 [1] CRAN (R 4.5.0)
#>  htmltools      0.5.8.1 2024-04-04 [1] CRAN (R 4.5.0)
#>  knitr          1.50    2025-03-16 [1] CRAN (R 4.5.0)
#>  labeling       0.4.3   2023-08-29 [1] CRAN (R 4.5.0)
#>  lifecycle      1.0.4   2023-11-07 [1] CRAN (R 4.5.0)
#>  magrittr       2.0.4   2025-09-12 [1] CRAN (R 4.5.0)
#>  marquee      * 1.2.1   2025-09-15 [1] CRAN (R 4.5.0)
#>  pillar         1.11.1  2025-09-17 [1] CRAN (R 4.5.0)
#>  pkgconfig      2.0.3   2019-09-22 [1] CRAN (R 4.5.0)
#>  R6             2.6.1   2025-02-15 [1] CRAN (R 4.5.0)
#>  RColorBrewer   1.1-3   2022-04-03 [1] CRAN (R 4.5.0)
#>  reprex         2.1.1   2024-07-06 [1] CRAN (R 4.5.0)
#>  rlang          1.1.6   2025-04-11 [1] CRAN (R 4.5.0)
#>  rmarkdown      2.30    2025-09-28 [1] CRAN (R 4.5.0)
#>  rstudioapi     0.17.1  2024-10-22 [1] CRAN (R 4.5.0)
#>  S7             0.2.0   2024-11-07 [1] CRAN (R 4.5.0)
#>  scales         1.4.0   2025-04-24 [1] CRAN (R 4.5.0)
#>  sessioninfo    1.2.3   2025-02-05 [1] CRAN (R 4.5.0)
#>  tibble         3.3.0   2025-06-08 [1] CRAN (R 4.5.0)
#>  tidyselect     1.2.1   2024-03-11 [1] CRAN (R 4.5.0)
#>  vctrs          0.6.5   2023-12-01 [1] CRAN (R 4.5.0)
#>  withr          3.0.2   2024-10-28 [1] CRAN (R 4.5.0)
#>  xfun           0.53    2025-08-19 [1] CRAN (R 4.5.0)
#>  xml2           1.4.0   2025-08-20 [1] CRAN (R 4.5.0)
#>  yaml           2.3.10  2024-07-26 [1] CRAN (R 4.5.0)
#> 
#>  [1] /Users/nick_1/Library/R/arm64/4.5/library
#>  [2] /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
#>  * ── Packages attached to the search path.
#> 
#> ──────────────────────────────────────────────────────────────────────────────

Activity

  1. teunbrand commented on Oct 24, 2025

    @teunbrand
    Contributor

    It works if the plot.title setting is used instead of title.

    library(marquee)
    library(ggplot2)
    
    ggplot(mtcars) +
      geom_point(aes(mpg, disp)) +
      labs(title = "A {.red *marquee*} title\n* Look at this bullet list\n\n* great, huh?") +
      theme_gray(base_size = 6) +
      theme(plot.title = element_marquee())

    Created on 2025-10-24 with reprex v2.1.1

    This is due to how elements inherit and theme_gray()$plot.title is a regular text element overriding the parent marquee element.

  2. njtierney commented on Oct 26, 2025

    @njtierney
    ContributorAuthor

    Fantastic, thank you! 🙂 I've submitted a PR with the fixes to the R files - unfortunately I couldn't get document() to work as I ran into some strange Cstring error. Hopefully my PR is helpful :)

  3. added a commit that references this issue on Nov 11, 2026
    f190fe6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions