.gg_scale_consistent | R Documentation |
Multiple factor levels with custom labels are difficult to sync between graphs if some levels are missing in the second plot. This copies the palette from one plot to another. It is sometimes the case that we want to reuse the fill from one plot as the color for another.
.gg_scale_consistent(
plot,
original_aesthetic = c("fill", "color"),
target_aesthetic = original_aesthetic,
...
)
plot |
a ggplot with a colour scale to clone |
original_aesthetic |
the original aesthetic we are cloning (fill or color) |
target_aesthetic |
the aesthetic in the new plot we want to match. |
... |
Arguments passed on to
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.