Skip to content

Clement-Viguier/ShadeR

Repository files navigation

ShadeR

ShadeR provide a new geom for ggplot2, geom_fleck, to make dot density plots and an associated stat, aspect_shading, to generate shadding effect.

Installation

ShadeR is inspired by this post of Elio Campitelli and relies on his package metR for the computation of derivatives.

These two packages can be installed with the following comamands:

# install.packages("devtools")
devtools::install_github("eliocamp/metR")

# And intsallation of ShadeR:
devtools::install_github("Clement-Viguier/ShadeR")

Examples

An example of The Andes relief and Pacific Ocean ploted with geom_fleck and stat_aspect_shading: The Andes Like any geom_similar to point, geom_fleck accepts changes of aes like colour, used here to distinguish the ocean from the land.

THe resolution can be given as an aesthetic or is computed if res = NULL in the geom_fleck call.

Another aesthetic is * sun.angle * that modify the position of the sun for the shading computation by stat functions (only stat_aspect_shading for now). Below it is used with image_animate: Volcano rotating shade

Three one-line examples you can try once ShadeR is installed:

Author

  • Clement Viguier

Acknowledgments

  • Elio Campitelli for the shading code.
  • James Cheshire and Oliver Uberti for the inspiration.
  • ** Tyler Morgan-Wall ** for the shading computation from his rayshader package
  • Hadley Whickham for ggplot2.

About

ggplot2 extension to create fleck maps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages