Giter VIP home page Giter VIP logo

bprdcolours's Introduction

BPRDcolors

Author: Michael McCarthy

License: MIT

The BPRDcolours package provides a collection of color palettes based on Star Trek. It also offers functions for custom palettes and scale_* functions for use with ggplot2.

Installation

Install the CRAN release of BPRDcolours with

install.packages("BPRDcolours")

Install the development version from GitHub with

# install.packages("remotes")
remotes::install_github("mccarthy-m-g/BPRDcolours")

Examples

Basics

library(BPRDcolours)
library(ggplot2)

bprd_pal("hellboy")
#> [1] "#DA3A2C" "#FFD576" "#B19F61" "#6F5F45"

bprd_pal("abe")
#> [1] "#006E7D" "#3A948A" "#C1DFA3" "#A0DED3"

Preview the hellboy and abe palettes.

view_bprd_pals(c("hellboy", "abe"))

Scale functions for use with ggplot2

p <- ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) + 
  geom_point(size = 5, alpha = 0.75)
p + scale_colour_bprd() # starfleet is default palette

p <- ggplot(diamonds, aes(carat, stat(count), fill = cut)) +
  geom_density(position = "fill")
p + scale_fill_bprd("hellboy")

p + scale_fill_bprd("abe")

p + scale_fill_bprd("liz")

d <- diamonds[diamonds$cut >= "Very Good", ]
p <- ggplot(d, aes(carat, stat(count), fill = cut)) +
  geom_density(position = "fill")
p + scale_fill_bprd("roger")

All predefined palettes

# See available palette names
bprd_pal()
#> [1] "bprd_series"     "hellboy"         "abe"             "liz"            
#> [5] "roger"           "lobster_johnson"

# view all predefined palettes
view_bprd_pals()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.