Created
October 25, 2021 10:49
-
-
Save jhnwllr/ff72212a51b0e7bf9303011e2474b6af to your computer and use it in GitHub Desktop.
Classic GBIF barplot used for everything
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
breaks = scales::pretty_breaks(n = 5)(c(0,3e6)) | |
labels = gbifapi::plot_label_maker(breaks,unit_MK = "K",unit_scale = 1e-3) | |
p = ggplot(pd,aes(class,n)) + | |
scale_y_continuous(breaks = breaks,label = labels) + | |
geom_col(stat="identity",fill="#4B9E46") + | |
coord_flip() + | |
xlab("") + | |
ylab("number of 'sensitive' occurrences") + | |
theme_bw() + | |
theme(axis.text.y=element_text(face="plain",size=12,color="#535362")) + | |
theme(axis.title.x = element_text(margin = margin(t = 10, r = 0, b = 5, l = 0), size = 11, face="plain")) + | |
labs(caption="sensitive = on CITES + certain location + NT,VU,EN,CR") | |
save_dir = "C:/Users/ftw712/Desktop/iucn_project_2021/plots/" | |
gbifapi::save_ggplot_formats(p,save_dir,"class_barplot",height=4,width=6,formats=c("pdf","jpg","svg")) |
Author
jhnwllr
commented
Oct 25, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment