2 colums of data on one axis?

So i have 2 categories (small and large) and was wondering how i can plot the small and large area columns on the same axis on a scatter graph?

library(tidyverse)

(pretend_data <- tibble(
  size_category = c(rep("Small",10),rep("Large",10)),
  x_val = c(sample.int(10,10,replace=TRUE),
            sample.int(20,10,replace=TRUE)),
  y_val = c(sample.int(10,10,replace=TRUE),
  sample.int(20,10,replace=TRUE))
))
    
ggplot(data=pretend_data,
       mapping = aes(color=size_category,
                     x=x_val,
                     y=y_val)) +
  geom_point()

image

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.