Created
June 1, 2025 19:28
-
-
Save danlewer/c5b441a6d75f36e60b830f4fd7c1a240 to your computer and use it in GitHub Desktop.
Simple function to show a vector of colours in a plot device
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| show_cols <- function (x) { | |
| plot(1, type = 'n', xlim = c(0, length(x)), ylim = c(0, 1), axes = F, xlab = NA, ylab = NA) | |
| rect(0:(length(x)-1), 0, 1:length(x), 1, col = x) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment