ggRtsy

Katelyn Diaz, Tess Goldmann, Silas Weden

2023-09-14

goghColors

The ggArtsyR() package works with ggplot2() to add an additional color palette to the user’s repertoire. This is the goghColors dataset, which contains the RGB and hex codes of colors picked from Van Gogh paintings.

knitr::kable(head(goghColors,10))
name rgb hex
Absolute Zero (0, 72, 186) #0048ba
Acid Green (176, 191, 26) #b0bf1a
Alice Blue (240, 248, 255) #f0f8ff
Alizarin (227, 38, 54) #e32636
Amaranth (229, 43, 80) #e52b50
Amber (255, 191, 0) #ffbf00
Amethyst (153, 102, 204) #9966cc
Antique White (250, 235, 215) #faebd7
Antique White (255, 239, 219) #ffefdb
Antique White (238, 223, 204) #eedfcc

RectangleFiller()

ggRtsy also has a function that work alongside ggplot2() to create more interesting data visualizations and add contextual information to the user’s plots. This main function is RectangleFiller(), which divides data visualizations into a specified number of colored quadrants based on the number of input colors, improving the readability of graphs.

Using Hex Codes from the dataset goghColors, three colors were added on top of a ggplot sample scatter plot. Based on the plot, the function automatically calculated three equal widths of the rectangles, and stretched them to upper and lower bounds on the y-axis.

RectangleFiller(plotExample, c("#e32636", "#9966cc", "#f4c2c2", "#e16827"))

rgbToHex()

This package comes with rgbToHex, converting rgb colors into hex code colors.

rgbToHex(c("(225, 104, 39)","(60, 90, 202)"))
#> [1] "#e16827" "#3c5aca"

Gogh Painting Sets

The dataset goghPaintingSets contains a list of every Gogh painting, some information about them, and a set of colors randomly pulled from it. This can be used to make your own Gogh themed colorsets.

knitr::kable(head(goghPaintingSets,4))
name colors year genre style link
The Goat Herd (‘#241E26’, ‘#3F3A40’, ‘#8B888C’, ‘#D8D7D9’, ‘#BEBABF’) 1862 sketch and study Realism https://uploads6.wikiart.org/images/vincent-van-gogh/the-goat-herd-1862.jpg!Large.jpg
Dog (‘#BFB6AE’, ‘#D9D0C7’, ‘#F2EAE4’, ‘#736968’, ‘#261E1E’) 1862 animal painting Post-Impressionism https://uploads3.wikiart.org/images/vincent-van-gogh/dog(1).jpg!Large.jpg
Milk Jug (‘#0D0B0B’, ‘#403C3D’, ‘#F2E8DF’, ‘#D9D0C7’, ‘#8C8887’) 1862 still life Realism https://uploads5.wikiart.org/images/vincent-van-gogh/milk-jug.jpg!Large.jpg
Barn and Farmhouse (‘#F2EADF’, ‘#BFBBB8’, ‘#736E6C’, ‘#0D0A0A’, ‘#403B3B’) 1864 landscape Post-Impressionism https://uploads0.wikiart.org/images/vincent-van-gogh/barn-and-farmhouse(1).jpg!Large.jpg

gogh_palettes_pop

For ease of use, gogh_palettes_pop is a list of color palettes from the most well known Gogh paintings.

cafeTerrace = ‘#2A6BBF’, ‘#3F6CA6’, ‘#F2C84B’, ‘#D99036’, ‘#BF6734’

The palettes can be used in graphs as follows:

scale_color_gogh Continuous

plotExample2 <- ggplot(exampleData, aes(x = height, y = mass, color = birth_year)) +
  geom_point(size = 2) +
  scale_color_gogh(palette = "cafeTerrace", discrete = FALSE) +
  theme_minimal()
plotExample2

scale_color_gogh Discrete

ggplot(storms, aes(x = hour, y = wind, color = status)) +
  geom_point(size = 3) +
  scale_color_gogh(palette = "wheatField", discrete = TRUE, reverse=FALSE) +
  theme_minimal()

scale_fill_gogh Discrete

ggplot(storms, aes(x = category, fill = status)) +
  geom_bar() +
  scale_fill_gogh(palette = "almondBlossoms", discrete = TRUE, reverse=FALSE) +
  theme_minimal()