Add all text to your ggplot 2 plots

Include the code chunk option fig-alt in the code chunk that generates a plot to give the plot an alt-text attribute, like so:
#| fig-alt: the alt-text goes here

Read the full article