Let us load the tidyverse library and load the data. The data i took is of diamonds that i am working on in my stat computing project work.
library(tidyverse)
diamonds <- read_csv("https://raw.githubusercontent.com/Kishoredanda/diamonds_data/main/diamonds.csv")
diamonds %>%
ggplot(aes(x = price, y = carat, color = cut) ) +
geom_jitter(alpha = .25) +
scale_y_continuous(name = "carat") +
scale_x_continuous(name = "Price") +
ggtitle(" Price Vs Carat")
This visualization is an exploration of the price of various diamonds based on the type of cut and number of carats. In this scatter plot we can see that price of diamonds is increasing linearly with carat value for all types of cuts of diamonds but this phenomenon is observed only upto a certain price point of approximately $5000, after this point the price keeps increasing for same carats of diamonds. This increase in price can be explained by various other factors of diamond making like color, clarity, etc.