Description Usage Arguments Details Value Examples
This palette is specially designed for data consisting of counts. It is intended to show both presence/absence and relative proportion in the same plot. For data containing N counts in the largest sample, the saturated rainbow palette should be created with length N + 1.
1 | saturated_rainbow(n, saturation_limit = 0.4)
|
n |
Length of the palette |
saturation_limit |
The fraction of the total palette length over which the rainbow extends. Above this limit, the color will remain the same. |
The first element of the palette is white, indicating zero counts. The second element is dark blue, indicating one or very few counts. As the proportion increases within a sample, the palette transitions from blue to green, yellow, orange, and finally red.
The function defines a saturation limit, above which the color remains bright red. The saturation limit is set to 40 items with the largest relative proportion in a sample. The default value seems to work well for a wide range of circumstances – it allows items that are strongly dominant in a sample to be identified across the plot. Ideally, the total number of red squares should be kept low, never more than one per sample.
A vector of colors.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.