Easier legends for R graphics
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pkg/easylegend
www
.gitignore
.travis.yml
LICENSE
README.md
appveyor.yml
easylegend_1_RCMDbuild.bat
easylegend_2_RCMDcheck.bat
easylegend_3_RCMDINSTALL_build.BAT
easylegend_4_RCMDRd2pdf.BAT
easylegend_Document.R
packageUtilities.R

README.md

Linux: Linux Build Status (Travis CI). Windows: Windows Build Status (AppVeyor)

easylegend

Automatic plot overlay and legend for categorical and continuous variables (symbols, colors, ...)

Author: Julien MOEYS. Package description: See DESCRIPTION.

Introduction

easylegend is a package for the R Project for Statistical Computing

easylegend makes it easier to display additional categorical or continuous variable(s) (say Z) on a plot (xy scatter plot, image, spatial data), with Z-dependent symbol characters and / or colors (for symbols, lines or fillings), and preparing the plot legend(s). Color scales can be categorical (if Z is categorical), or continuous (if Z is continuous).

easylegend generates Z-dependent plot aesthetics automatically, but the user can customise many aesthetics parameters.

Continuous color scales (or ramps) in easylegend can be highly customised, and support multi-step color ramps with intermediate color gradient and custom breaks. The legend for continuous color scales is not linearly proportional to Z, and thus can be used with data that spans across several order of magnitudes (Such as pesticide concentrations, which is the primary motivation for that package), or with infinite values in the breaks (i.e. Upper or lower bounds not clearly defined). They can be used with standard plots, but also with image() or raster::plot().

Examples

Here are a simple examples of what can be obtained with easylegend:

Example 01

Image 01, Example, package easylegend

Click on the image to view the source code of this example.

Example 02

Image 02, Example, package easylegend

Click on the image to view the source code of this example.

Example 03

This example show how easylegend can be used with the package raster to generate custom legends for data that span across a log-scale.

Image 03, Example, package easylegend

Click on the image to view the source code of this example.

Please notice that the package rasterVis provides advanced way to customise a raster-plot (but as far as I know not for custom non-linear legends like the one above)