ggsave("plot1.png", width =1.75, height =4, units ="in", bg="black")
img1 <-image_read("word_cloud.png")img2 <-image_read("plot1.png")combined <-image_append(c(img1, img2), stack =FALSE)#image_write(combined, "combined.png")title_text <-paste("In Project Gutenberg, ", comma(lang_counts$total_languages[1]), " out of ", comma(dim(gutenberg_languages)[1]), "books are in English. The word cloud is based on the book counts in different languages, excluding English. Counts for top ten languages are shown on the right.")title_text <-paste(strwrap(title_text, width =75), collapse ="\n")title_image <-image_blank(width =image_info(combined)$width,height =160, # adjust height as neededcolor ="black") %>%image_annotate(text = title_text,size =40, # adjust font sizecolor ="grey",gravity ="center")final_image <-image_composite(combined, title_image, offset ="+0+0")image_write(final_image, "combined_with_title.png")