i

R Programming Complete Tutorial

ggplot2 Area Plot

Area plots are useful for visualizing one or more variables over time. We can create area charts using geom_area function. We are using diamond data set as source data in X. We are using price, and in fill, we set cut. It will generate an area plot for mentioning the diamond cut with its price.

Example of Area Plot:

Graph Output: