Skip to content

Commit

Permalink
Update make_maps.R
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasHohmann committed Mar 5, 2024
1 parent 36c7052 commit c9767f5
Showing 1 changed file with 76 additions and 2 deletions.
78 changes: 76 additions & 2 deletions code/make_maps.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ class(coord)

# Whole dataset map
qmplot(lon,lat,data=coord,maptype="stamen_toner_lite",color=I("red"))
# OR
ggmap(Med_map)+geom_point(data=coord,aes(color="darkred",shape=Age))
ggsave("dataset_map.pdf",width=9,height=5)

# Color by stage
Tortonian<-filter(coord,Age=="Tortonian")
Messinian<-filter(coord,Age=="pre-evaporitic Messinian")
Zanclean<-filter(coord,Age=="Zanclean")
ggmap(Med_map)+geom_point(data=Tortonian,color="blue")+geom_point(data=Messinian,color="red")+geom_point(data=Zanclean,color="yellow")
ggmap(Med_map)+geom_point(data=Tortonian,color="darkblue")+geom_point(data=Messinian,color="darkred")+geom_point(data=Zanclean,color="gold2")
ggsave("locs_by_stage_map.pdf",width=9,height=5)

# Color by region
Expand All @@ -48,4 +50,76 @@ ggmap(Med_map)+
labs(x="longitude",y="latitude")+
theme(legend.position="bottom")

ggsave("stage_region_map2.pdf",width=9,height=5)
ggsave("stage_region_map2.pdf",width=9,height=5)

# plot for each group separately
tax_groups<-unique(coord$group.name)
pforams<-filter(coord,group.name=="planktic_foraminifera")
nano<-filter(coord,group.name=="nanoplankton")
ostracods<-filter(coord,group.name=="ostracods")
bforams<-filter(coord,group.name=="benthic_foraminifera")
gastr<-filter(coord,group.name=="gastropods")
echinoids<-filter(coord,group.name=="echinoids")
fish<-filter(coord,group.name=="fish")
mmammals<-filter(coord, group.name=="marine_mammals")
biv<-filter(coord,group.name=="bivalves")
corals<-filter(coord,group.name=="corals")
dino<-filter(coord,group.name=="dinocysts")
sharks<-filter(coord,group.name=="sharks")
bryo<-filter(coord,group.name=="bryozoans")
othermolluscs<-filter(coord, group.name=="scaphopod_chitons_cephalopods")

ggmap(Med_map)+geom_point(data=pforams,aes(color=Age))
ggsave("pforams.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=nano,aes(color=Age))
ggsave("nano.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=ostracods,aes(color=Age))
ggsave("ostracods.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=bforams,aes(color=Age))
ggsave("bforams.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=gastr,aes(color=Age))
ggsave("gastro.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=echinoids,aes(color=Age))
ggsave("echinoids.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=fish,aes(color=Age))
ggsave("fish.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=mmammals,aes(color=Age))
ggsave("marine_mammals.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=biv,aes(color=Age))
ggsave("bivalves.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=corals,aes(color=Age))
ggsave("corals.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=dino,aes(color=Age))
ggsave("dino.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=sharks,aes(color=Age))
ggsave("sharks.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=bryo,aes(color=Age))
ggsave("bryo.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=othermolluscs,aes(color=Age))
ggsave("othermolluscs.pdf",width=9,height=5)

# plot groups split into plankton, benthos, necton and large marine vertebrates
# plankton: planktic_foraminifera, nanoplankton, dinocysts
# benthos: benthic_foraminifera, bryozoans, molluscs, echinoids, corals
# necton: fish, ostracods
# large marine vertebrates: sharks, marine mammals
plankton<-rbind(pforams,nano,dino)
benthos<-rbind(bforams,bryo,othermolluscs,gastr,biv,echinoids,corals)
necton<-rbind(fish,ostracods)
large_mar_vert<-rbind(sharks,mmammals)

ggmap(Med_map)+geom_point(data=plankton,color="gold1",aes(shape=Age))+geom_point(data=benthos,color="red",aes(shape=Age))+geom_point(data=necton,color="blue",aes(shape=Age))+geom_point(data=large_mar_vert,color="green",aes(shape=Age))
ggsave("fgroups.pdf",width=9,height=5)

0 comments on commit c9767f5

Please sign in to comment.