Customize caption text
element_text() methods can be used to customize the caption within graph
R
library (ggplot2) ggplot (iris, aes (x = Sepal.Length, y = Sepal.Width)) + geom_point ()+ # adding caption and subtitle labs (subtitle= "Scatter plot - Examples" , caption= "w3wiki" )+ # size of the caption theme (plot.caption= element_text (size=15, color= "Green" )) |
Output:
How to Add Caption to a ggplot in R?
In this article, we are going to see how we can add a caption to a plot in R Programming Language. The caption is much important in data visualization to display some details related to graphs.