I’m using a code to plot the position of vents globally, using bathymetry from getNOAA.bathy and data from InterRidge vents database.
Anyway, my code for the plot is this:
# Plot the map
`base_map <- ggplot() +
geom_sf(data = global_batyf, aes(color = Depth)) +
scale_fill_scico(palette = "broc", limits = c(-4000, 0)) +
geom_sf(data = world, fill = "lightgray", color = NA) +
coord_sf(crs = "+proj=robin")`
# Add faceting based on Type variable in vents_sf dataset
p1 <- base_map +
new_scale_color() +
geom_sf(data = vents_sf, aes(color = Activity, shape = Type), size = 0.8) +
scale_color_manual(values = c("#2D936C", "#f9dc5c", "#cd4631")) +
coord_sf(crs = "+proj=robin") +
labs(title = "Global vents distribution - Robinson Projection",
x = "Longitude",
y = "Latitude") +
geom_text(x = c(-170, -50, 130), y = c(85, 35, -60), label = c("Longitude: -180 0 180", "Latitude: -90 -30 0 30 90"), hjust = 0, vjust = 0, size = 4, color = "gray50") +
facet_wrap(~Type, labeller = as_labeller(c(`Deep-sea vent` = "Deep-sea vent distribution", 'Shallow vent' = "Shallow vent distribution"))) +
theme(strip.background = element_rect(fill = "transparent"),
strip.text = element_text(face = "bold", color = "black", size = 12),
plot.title = element_text(hjust = 0.5, color = "black"),
axis.title.x = element_text(hjust = 0.5),
axis.title.y = element_text(hjust = 0.5))
print(p1)
The problem is that is coming outside like this:
enter image description here
I would like to have the axis with Long and Lat around the globe with reference values, do you have some suggestions or improvement?
New contributor
l.gallucci is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.