geom_christmas_tree(): a new geom for ggplot2 v2.0

Version 2.0 of the ggplot2 package (on GitHub) has a very nice mechanism for adding new geoms and stats (more about it here).
Christmas are coming, so maybe one would like to make his plots more tree’ish?
Below you will find a definition of geom_christmas_tree() geom. It supports following aesthetics: size (number of segments), fill, color, x and y.

With mpg data you can plot a colourful forest.


With iris dataset you can plot three hills and few trees.


Here is the full definition of the geom_christmas_tree() geom (tested with ggplot2 v2.0).

Btw: you still have four days to submit your chRistmas tRee.

2 thoughts on “geom_christmas_tree(): a new geom for ggplot2 v2.0”

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *