library(ggalign)
#> Loading required package: ggplot2
#> ========================================
#> ggalign version 1.1.0.9000
#>
#> If you use it in published research, please cite:
#> Peng, Y.; Jiang, S.; Song, Y.; et al. ggalign: Bridging the Grammar of Graphics and Biological Multilayered Complexity. Advanced Science. 2025. doi:10.1002/advs.202507799
#> ========================================
circle_discrete()
Circlular plot
Construct a circular heatmap layout using ggalign’s grammar
circle_discrete(mat, radial = coord_radial(inner.radius = 0.1)) +
# add a dendrogram
align_dendro(aes(color = branch), k = 3L, size = 0.5) +
scale_color_brewer(palette = "Dark2") +
# add a heatmap
ggalign() +
geom_tile(aes(y = .column_index, fill = value)) +
scale_fill_viridis_c() +
# add a single tile for each group
ggalign(NULL, size = 0.1) +
geom_tile(aes(y = 1L, fill = .panel)) +
scale_fill_brewer(palette = "Dark2", guide = "none") &
theme_no_axes("y")