Title: | Mario Themed 'ggplot2' Extensions |
---|---|
Description: | Provides Mario and Luigi themed 'ggplot2' extensions. This includes color palettes based on major characters and games. This also provides a warp pipe bar graph style. |
Authors: | Christopher T. Kenny [aut, cre]
|
Maintainer: | Christopher T. Kenny <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2024-09-01 02:45:47 UTC |
Source: | https://github.com/christopherkenny/luigg |
Warp Pipe Bar Graph
geom_pipe( mapping = NULL, data = NULL, stat = "identity", position = "identity", rule = "evenodd", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
geom_pipe( mapping = NULL, data = NULL, stat = "identity", position = "identity", rule = "evenodd", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this
layer, either as a |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
rule |
Either |
... |
Other arguments passed on to |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
a ggplot
set.seed(1) data.frame(x = as.character(1:4), n = 100 * runif(n = 4, 0, .5)) |> ggplot2::ggplot(ggplot2::aes(x = x, y = n, fill = x)) + geom_pipe() + scale_fill_luigg(palette = 'warp_pipe') + ggplot2::theme_void()
set.seed(1) data.frame(x = as.character(1:4), n = 100 * runif(n = 4, 0, .5)) |> ggplot2::ggplot(ggplot2::aes(x = x, y = n, fill = x)) + geom_pipe() + scale_fill_luigg(palette = 'warp_pipe') + ggplot2::theme_void()
Color palettes from various Mario/Nintendo games
luigg
luigg
list of character vectors of type c('palette', 'character')
Included palettes:
super_mario, Super Mario Bros. palette (from Politis et al 2017)
double_dash, Mario Kart Double Dash palette
Dionysios Politis et. al. International Journal of New Technologies in Science and Engineering Vol. 4, Issue. 1, Jan 2017, ISSN 2349-0780
plot(luigg$super_mario)
plot(luigg$super_mario)
ggplot2
Mario and Luigi Color Scales for ggplot2
scale_color_luigg(palette = "super_mario", which = NULL, ..., reverse = FALSE) scale_fill_luigg(palette = "super_mario", which = NULL, ..., reverse = FALSE) scale_colour_luigg(palette = "super_mario", which = NULL, ..., reverse = FALSE)
scale_color_luigg(palette = "super_mario", which = NULL, ..., reverse = FALSE) scale_fill_luigg(palette = "super_mario", which = NULL, ..., reverse = FALSE) scale_colour_luigg(palette = "super_mario", which = NULL, ..., reverse = FALSE)
palette |
palette from |
which |
numeric indices of colors to use. |
... |
arguments passed on to |
reverse |
Should the vector be reversed? Default is |
library(ggplot2) ggplot2::mpg |> ggplot() + geom_point(aes(displ, hwy, colour = class)) + scale_color_luigg(palette = 'warp_pipe') ggplot2::mpg |> ggplot() + geom_point(aes(displ, hwy, fill = class), pch = 23, color = 'transparent') + scale_fill_luigg(palette = 'warp_pipe')
library(ggplot2) ggplot2::mpg |> ggplot() + geom_point(aes(displ, hwy, colour = class)) + scale_color_luigg(palette = 'warp_pipe') ggplot2::mpg |> ggplot() + geom_point(aes(displ, hwy, fill = class), pch = 23, color = 'transparent') + scale_fill_luigg(palette = 'warp_pipe')