Easiest way to draw semi-circles on US map using R

  Kiến thức lập trình

I have a ggplot of US statewise map, for each state it shows the two circles overlapping for two columns in the dataframe. Here’s the code:

  ggplot() +
  geom_polygon(aes(x = long, y = lat, group = group),
               fill = "lightgray",
               color = "white") +
  geom_point(aes(x = x, y = y, size = val_prog),
             color = "blue",
             alpha = 0.4) +
  geom_point(aes(x = x, y = y, size = val_cons),
             color = "red",
             alpha = 0.4) +
  coord_map() +
  scale_size_continuous(range = c(3, 10)) +
  labs(title = "Circles on Map",
       x = NULL,
       y = NULL) +
  theme_minimal() +
  theme(
    axis.text = element_blank(),
    axis.ticks = element_blank(),
    panel.grid = element_blank()
  )

Instead of showing two overlapping circles, I want to show two semi-circles of different sizes and colors, how do I do this?

LEAVE A COMMENT