Title: | Colors for NEST Graphs |
---|---|
Description: | Clinical reporting figures require to use consistent colors and configurations. As a part of the Roche open-source clinical reporting project, namely the NEST project, the 'nestcolor' package specifies the color code and default theme with specifying 'ggplot2' theme parameters. Users can easily customize color and theme settings before using the reset of NEST packages to ensure consistent settings in both static and interactive output at the downstream. |
Authors: | Joe Zhu [aut, cre], Emily de la Rua [aut], F. Hoffmann-La Roche AG [cph, fnd] |
Maintainer: | Joe Zhu <[email protected]> |
License: | Apache License 2.0 |
Version: | 0.1.2.9017 |
Built: | 2024-11-28 05:56:27 UTC |
Source: | https://github.com/insightsengineering/nestcolor |
A standardized color palette to be used for all plots within the NEST project.
color_palette(n = 10, palette = "nest")
color_palette(n = 10, palette = "nest")
n |
(
|
palette |
(
|
A list of hex color code
library(grid) plot_pal <- function(x) { grid.newpage() pushViewport(plotViewport(rep(1, 4))) pushViewport(viewport(layout = grid.layout(1, ncol = length(x)))) for (i in seq_along(x)) { grid.rect( gp = gpar(fill = x[i], col = NA), vp = viewport(layout.pos.col = i, layout.pos.row = 1) ) } } plot_pal(color_palette(n = 10, palette = "nest")) plot_pal(color_palette(n = 10, palette = "stream")) plot_pal(color_palette(n = 10, palette = "viridis")) plot_pal(color_palette(n = 10, palette = "accessible"))
library(grid) plot_pal <- function(x) { grid.newpage() pushViewport(plotViewport(rep(1, 4))) pushViewport(viewport(layout = grid.layout(1, ncol = length(x)))) for (i in seq_along(x)) { grid.rect( gp = gpar(fill = x[i], col = NA), vp = viewport(layout.pos.col = i, layout.pos.row = 1) ) } } plot_pal(color_palette(n = 10, palette = "nest")) plot_pal(color_palette(n = 10, palette = "stream")) plot_pal(color_palette(n = 10, palette = "viridis")) plot_pal(color_palette(n = 10, palette = "accessible"))
NEST
ggplot2
themeReturns a custom NEST
ggplot2
theme
theme_nest(font_size = 10, ...)
theme_nest(font_size = 10, ...)
font_size |
( |
... |
( |
Return ggplot theme
plot <- ggplot2::ggplot(iris, ggplot2::aes(x = Sepal.Length, y = Sepal.Width)) + ggplot2::geom_point() + theme_nest()
plot <- ggplot2::ggplot(iris, ggplot2::aes(x = Sepal.Length, y = Sepal.Width)) + ggplot2::geom_point() + theme_nest()