get_display_color {loon} | R Documentation |
Return the Displayed Color
Description
Always reflect the current displayed color.
Usage
get_display_color(color, selected)
Arguments
color |
the |
selected |
the selected states |
Details
In loon
, each element (i.e. point, bin, line) has a "temporary" color and
a "permanent" color. If one element is selected, the color is switched to the "temporary" color to highlight it.
If the selection state is eliminated, the "permanent" color of this element will be displayed.
Our function always gives the "temporary" displayed color.
Value
The color shown on the plot
Examples
if(interactive()) {
p <- l_plot(1:10)
p['selected'][c(1,3,5)] <- TRUE
displayedColor <- get_display_color(p['color'], p['selected'])
plot(1:10, bg = as_hex6color(displayedColor), pch = 21)
}
[Package loon version 1.4.1 Index]