0

我对 R 很陌生,并且已经准备好为作业绘制图,但每当我尝试打印我的图时,我都会收到错误消息“提供连续比例的离散值”。我的代码是

S_america <- world %>% ggplot() + 
  geom_sf() + 
  geom_sf(data = volcanoes_2, aes( size = VEI, colour = "Total Damage ($Mil)"), shape = 17, na.rm = TRUE) + 
  coord_sf(xlim = c(-125, -30), ylim = c(-60, 35), expand = FALSE) + 
  scale_fill_viridis_c(alpha = 1, begin = 0, end = 1, direction = -1, option = "viridis", aesthetics = "colour") + 
  annotation_north_arrow(location = "tr", which_north = "true", 
                         pad_x = unit(0.1, "in"), pad_y = unit(0.1, "in"),
                         style = north_arrow_fancy_orienteering) + 
  labs(x = "Longitude", y = "Latitude", colour = "Total Damage ($Mil)", size = "VEI", title = "Total Damage in $Millions USD caused by Volcanic Eruptions in South America") + 
  theme(plot.title = element_text(colour = "black", face = "bold", size = 16, hjust = 0), 
        plot.caption = element_text(colour = "grey50", face = "italic", size = 6), 
        axis.title = element_text(colour = "black", face = "italic", size = 10), 
        legend.title = element_text(colour = "black", face = "bold", size = 10))

print(S_america)

其余代码运行良好,没有错误,只有当我尝试打印时才会遇到问题。任何帮助将不胜感激

4

0 回答 0