Chapter 22 Plot aesthetics in ArchR

Making useful and interpretable plots is one of the key goals of ArchR. We have done our best to make sensible defaults and to make a collection of aesthetically appealing color palettes available to users. However, we also want to make it possible to change the various default settings and manipulate plot aesthetics to your liking. This chapter provides a basic guide for how to alter these various plot aesthetics.

Importantly, ArchR has some base plotting functions that are recurrently used and many other plotting functions in ArchR are just wrappers around these base plotting functions. You can read about each of these individual functions in the “Plotting / aesthetic functions” section of the function documentation page. For example plotEmbedding() is a wrapper around the ggPoint() function (which is a wrapper around ggplot2). Other commonly used plotting wrapper functions in ArchR include ggGroup(), ggHex(), and ggOneToOne(). Often times, when you are using a function such as plotEmbedding(), ArchR allows you to pass arguments through to ggPoint() or ggHex() to manipulate various aspects of plot aesthetics using the ... argument.

As a preface to the sections in this chapter, ArchR is not a one-stop-shop for every plot customization you could desire. What you cannot tweak programatically, you will have to tweak “in post” in a vector graphics software such as Adobe Illustrator. The plots output by ArchR often contain complex layers and clipping masks and you should familiarize yourself with those if you plan to edit ArchR output plots by hand.

Lastly, ArchR attempts to default to rasterizing plots with many individual points. For example, in an embedding, you could have one point for every cell. If you have tens-of-thousands of cells, this means your plots will have tens-of-thousands of points on them which can be challenging to display and edit. To get around this, ArchR “rasterizes” or “flattens” the plot area while maintaining the rest of the plot elements (text, lines, legend, etc.) as editable vector graphics.