All Projects β†’ aljrico β†’ Harrypotter

aljrico / Harrypotter

Licence: other
🎨 Harry Potter inspired palette for R

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Harrypotter

Wesanderson
A Wes Anderson color palette for R
Stars: ✭ 1,343 (+1934.85%)
Mutual labels:  plot, color-palette
gameofthrones
🎨 Game of Thrones inspired palette for R
Stars: ✭ 69 (+4.55%)
Mutual labels:  plot, color-palette
Vapeplot
matplotlib extension for vaporwave aesthetics
Stars: ✭ 483 (+631.82%)
Mutual labels:  plot, color-palette
Github
a module for building, searching, installing, managing, and mining Stata packages from GitHub
Stars: ✭ 56 (-15.15%)
Mutual labels:  package
Firedata
Firebase + R
Stars: ✭ 57 (-13.64%)
Mutual labels:  package
Asciichart
Nice-looking lightweight console ASCII line charts β•­β”ˆβ•― for NodeJS, browsers and terminal, no dependencies
Stars: ✭ 1,107 (+1577.27%)
Mutual labels:  plot
Laravel Packme
A CLI starter pack for developing a package with Laravel 5
Stars: ✭ 64 (-3.03%)
Mutual labels:  package
Colorschemes.jl
colorschemes, colormaps, gradients, and palettes
Stars: ✭ 55 (-16.67%)
Mutual labels:  color-palette
Sublime Text Plugins For Frontend Web Development
πŸ“ Collection of plugins for Frontend Web Development
Stars: ✭ 1,127 (+1607.58%)
Mutual labels:  package
Shield
The core shield package.
Stars: ✭ 60 (-9.09%)
Mutual labels:  package
Ggthemes
Additional themes, scales, and geoms for ggplot2
Stars: ✭ 1,107 (+1577.27%)
Mutual labels:  plot
Unityasync
Task and Async Utility Package for Unity. Start co-routines from anywhere.
Stars: ✭ 58 (-12.12%)
Mutual labels:  package
Engraver
PoCC Burstcoin Reference Plotter
Stars: ✭ 61 (-7.58%)
Mutual labels:  plot
Laravel Reviewable
Adds a reviewable feature to your laravel app.
Stars: ✭ 57 (-13.64%)
Mutual labels:  package
Npmf
Fetch quick info of a npm pacakge using terminal
Stars: ✭ 64 (-3.03%)
Mutual labels:  package
Espresso
🚚 Espresso is an express delivery tracking app designed with Material Design style, built on MVP(Model-View-Presenter) architecture with RxJava2, Retrofit2, Realm database and ZXing
Stars: ✭ 1,084 (+1542.42%)
Mutual labels:  package
Ggstatsplot
Enhancing `ggplot2` plots with statistical analysis πŸ“ŠπŸŽ¨πŸ“£
Stars: ✭ 1,121 (+1598.48%)
Mutual labels:  plot
Iconhandler
Tint you Icons, change the size, apply alpha color and set a position easily. πŸ‘“
Stars: ✭ 59 (-10.61%)
Mutual labels:  color-palette
React Native Markdown Editor
A markdown editor like github comment editor (contains preview, helper buttons)
Stars: ✭ 59 (-10.61%)
Mutual labels:  package
Atom Latex
The only LaTeX package you need for typesetting with Atom.
Stars: ✭ 60 (-9.09%)
Mutual labels:  package

harrypotter

cran version rstudio mirror per-month downloads rstudio mirror total downloads

This package provides the first round of palettes derived from the Harry Potter film series.

At its first version, it simply contains the palettes of the Hogwarts Houses. They have been chosen manually, taking into account its consistency with all the existing branding of the franchise, but its suitability for data visualisation.

Most of us need to listen to the music to understand how beautiful it is. But often that’s how statistics are presented: we show the notes instead of playing the music.

The colour palette should be beautiful, useful for plotting data and shoulr relate to desired style; in this case, should relate to the Harry Potter world. Some of the colours might change in future versions, in order to find this balance between suitability for plotting and relatable to the Harry Potter universe.

Installation

Just copy and execute this bunch of code and you'll have the last version of the package installed:

install.packages("harrypotter")

And you can now use it:

library(harrypotter)

Usage

The default colour scale of the package is the one named Always. If you prefer to choose another one, you'll need to specify which house you want the palette from.

You can get started using base R plot functions, and the hp() function. Its first argument n lets you set the number of colours to be mapped. This way you can set different resolutions. Let's say that you want a palette made from the house Gryffindor, then just type option = "Gryffindor".

pal <- hp(n = 8, house = "Gryffindor")
image(volcano, col = pal)

pal <- hp(n = 128, house = "Gryffindor")
image(volcano, col = pal)

ggplot2

Of course, this package has specific functions to behave seamlessly with the best data visiualisation library available. The package contains colour scale functions for ggplot2 plots: scale_colour_hp() and scale_fill_hp().

Here is a made up example using the colours from the house of Hufflepuff,

library(ggplot2)
ggplot(data.frame(x = rnorm(1e4), y = rnorm(1e4)), aes(x = x, y = y)) +
  geom_hex() + 
	coord_fixed() +
  scale_fill_hp(house = "hufflepuff") + 
	theme_bw()

or more made-up heatmaps:

Using the same function we can also plot these cloropleth maps of U.S. unemployment:

Discrete Scales

But what if you want discrete scales? These functions also can be used for discrete scales with the argument discrete = TRUE. This argument, when TRUE, sets a finite number of sufficiently spaced colours within the selected palette to plot your data.

ggplot(diamonds, aes(factor(color), fill=factor(cut))) +
	geom_bar(colour = "black") +
	scale_fill_hp(discrete = TRUE, option = "ronweasley2", name = "Cut") +
	ylab("") +
	xlab("Colour") +
	coord_flip()

You can also use discrete scales by adding _d() at the end of it instead, like scale_fill_hp_d().

dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
ggplot(dsamp, aes(carat, price)) +
	geom_point(aes(colour = clarity)) +
	scale_colour_hp_d(option = "LunaLovegood", name = "Clarity") +
	xlab("Carat") +
	ylab("Price")

Don't forget to try them all.

Palettes

option = "Mischief"

option = "Always"

option = "Sprout"

option = "LunaLovegood"

option = "HermioneGranger"

option = "HarryPotter"

option = "DracoMalfoy"

option = "RonWeasley"

option = "NewtScamander"

option = "Ravenclaw"

Acknowledgments

  • Special thanks to my buddy Alfredo for designing the logo.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].