Creating scatterplot for demonstration

Here we will use the iris dataset to plot scatterplot along with two different groups(Sepal.Length and Sepal.Width). To plot the scatterplot we will use we will be using the geom_point() function. Following is brief information about ggplot function, geom_point().

Syntax : geom_point(size, color, fill, shape, stroke)

R




library(tidyverse)
 
# Define the scatterplot
plot <- ggplot(iris, aes(Sepal.Length,
                      Sepal.Width,
                      color = Species))+
geom_point(shape = 21)
 
# display plot
plot


 
 

Output:

 

How to Highlight Groups with Convex Hull in ggplot2 in R?

In this article, we are going to see how to highlight groups with the convex hull in ggplot2 using R Programming Language. 

Convex hull polygon refers to the draw a line bounding box around the outermost points in each group.

Similar Reads

Creating scatterplot for demonstration

Here we will use the iris dataset to plot scatterplot along with two different groups(Sepal.Length and Sepal.Width). To plot the scatterplot we will use we will be using the geom_point() function. Following is brief information about ggplot function, geom_point()....

Highlight Groups with Convex Hull in ggplot2

...