This is an R HTML document. When you click the chunk like this:

Bar graph with plotted margin and background
  library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
  library(ggplot2)

   ggplot(mtcars, aes(x=cyl)) +
     geom_bar(fill="tomato") +
     theme(plot.background=element_rect(fill="steelblue"),
           plot.margin = unit(c(2, 4, 1, 3), "cm"))       # top, right, bottom, left
plot of chunk unnamed-chunk-1
Bar graph with annotation
  library(tidyverse)
  library(ggplot2)
  library(grid)

  my_grob = grobTree(textGrob(x=0.1, y=0.9, hjust=0,
                  "This text is at x=0.1 and y=0.9, relative!\n Anchor point is at 0,0",
    gp=gpar(col="firebrick", fontsize = 8, fontface="bold")))

    ggplot(mtcars, aes(x=cyl)) +
      geom_bar() + annotation_custom(my_grob) +
      labs(title="Annotation Example")
plot of chunk unnamed-chunk-2