knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of vizoR is to provide helper functions to help designing better visualizations in R.
This package is under active developpement. You can install it from github:
devtools::install_github("aneuraz/vizoR")
library(vizoR) pal5361 <- color_hex_palette_from_number(5361) pal5361
show_pal(pal5361)
library(vizoR) palCook <- color_hex_palette_from_name("Cook") palCook
show_pal(palCook)
palTerra <- colour_lovers_palette_from_number("292482/Terra") palTerra
show_pal(palTerra)
library(ggplot2) p <- ggplot(mtcars, aes(wt, mpg)) p + geom_point(size = 4, aes(colour = factor(cyl))) + scale_color_manual(values = pal5361) + theme_bw()
library(patchwork) # devtools.install_github("thomasp85/patchwork") p1 <- show_pal(cbp_pal(black = FALSE)(8)) p2 <- show_pal(cbp_pal(black = TRUE)(8)) p1 + p2 + patchwork::plot_layout(ncol = 1)
p <- ggplot(mtcars, aes(wt, mpg)) p + geom_point(size = 4, aes(colour = factor(cyl))) + scale_color_cbp(black = FALSE) + theme_bw()
dt <- generate_dataset_uniform(dataset_size = list(20,10, 15, 8), min_x = list(0, 1, 3, 3), max_x = list(3, 4, 5, 7), seed = 13) dplyr::glimpse(dt)
p <- ggplot(dt, aes(x, y)) p + geom_point(size = 4, aes(colour = group)) + scale_color_cbp(black = FALSE) + theme_bw()
theme_elegant
p <- ggplot(dt, aes(x, y)) p + geom_point(size = 4, aes(colour = group)) + scale_color_cbp(black = FALSE) + theme_elegant()
theme_elegant_dark
p1 <- ggplot(dt, aes(x, y)) p1 + geom_point(size = 4, aes(colour = group)) + scale_color_cbp(black = FALSE) + theme_elegant_dark()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.