The ggacmap function is written by ggplot2 and take the advantages of using scale or theme to modify the details.

Loading the packages

## Need help getting started? Try the cookbook for R:
## http://www.cookbook-r.com/Graphs/

Load the H3 AC map

Plotting examples

Plot the map is easy, just using ggacmap(your_acmap):

Change size of points

Show color legend

Oops, this is not what we want. ggplot2 does the right thing as we map the color to the actual color vector.

How if we want to label these groups with representative strains?

##  [1] "BI/15793/68" "BI/21793/72" "VI/3/75"     "BI/628/76"   "BA/1/79"    
##  [6] "SH/11/87"    "BE/352/89"   "BE/32/92"    "MA/G252/93"  "AU/10/97"   
## [11] "FU/411/02"
##  [1] "BI/68"   "BI/72"   "VI/75"   "BI/76"   "BA/79"   "SH/87"   "BE/89"  
##  [8] "BE/92"   "MA/G252" "AU/97"   "FU/02"

Remove type legend

Bonus: easy to put several figures in one page

The following example build a quick-and-dirty tree from the aligned sequences, and visualize the tree using ggtree with tip points colored by antigenic grouping information. We can therefore check whether the antigenic group information is consistent with genetic distance or not.

## Loading required package: ggtree
## Registered S3 method overwritten by 'treeio':
##   method     from
##   root.phylo ape
## ggtree v1.16.1  For help: https://yulab-smu.github.io/treedata-book/
## 
## If you use ggtree in published research, please cite the most appropriate paper(s):
## 
## - Guangchuang Yu, Tommy Tsan-Yuk Lam, Huachen Zhu, Yi Guan. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution 2018, accepted. doi: 10.1093/molbev/msy194- Guangchuang Yu, David Smith, Huachen Zhu, Yi Guan, Tommy Tsan-Yuk Lam. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. Methods in Ecology and Evolution 2017, 8(1):28-36, doi:10.1111/2041-210X.12628