hues-ggplot2-scales: iwanthue scales to use with ggplot2

Description Usage Arguments Value Author(s) Examples

Description

These functions allow you to use iwanthue() generated palettes with ggplot2 plots. You need ggplot2 installed for these to work. Note these only work with discrete scales.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
scale_colour_iwanthue(
  ...,
  hmin = 0,
  hmax = 360,
  cmin = 0,
  cmax = 180,
  lmin = 0,
  lmax = 100,
  random = FALSE,
  aesthetics = "colour"
)

scale_color_iwanthue(
  ...,
  hmin = 0,
  hmax = 360,
  cmin = 0,
  cmax = 180,
  lmin = 0,
  lmax = 100,
  random = FALSE,
  aesthetics = "colour"
)

scale_fill_iwanthue(
  ...,
  hmin = 0,
  hmax = 360,
  cmin = 0,
  cmax = 180,
  lmin = 0,
  lmax = 100,
  random = FALSE,
  aesthetics = "fill"
)

Arguments

...

Arguments to pass on to ggplot2::discrete_scale().

hmin

Numeric, in the range [0, 360]. The lower limit of the hue range to be clustered.

hmax

Numeric, in the range [0, 360]. The upper limit of the hue range to be clustered.

cmin

Numeric, in the range [0, 180]. The lower limit of the chroma range to be clustered.

cmax

Numeric, in the range [0, 180]. The upper limit of the chroma range to be clustered.

lmin

Numeric, in the range [0, 100]. The lower limit of the luminance range to be clustered.

lmax

Numeric, in the range [0, 100]. The upper limit of the luminance range to be clustered.

random

Logical. If TRUE, clustering will be determined by the existing RNG state. If FALSE, the seed will be set to 1 for clustering, and on exit, the function will restore the pre-existing RNG state.

aesthetics

Character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with. This can be useful, for example, to apply colour settings to the colour and fill aesthetics at the same time, via aesthetics = c("colour", "fill").

Value

A ScaleDiscrete object that can be added to a ggplot object.

Author(s)

Russell Dinnage r.dinnage@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
if (require('ggplot2')) {

   ggplot(iris, aes(x=Petal.Width, y=Petal.Length)) +
     geom_point(aes(color=Species), size=10) + 
     scale_colour_iwanthue()
    
   ggplot(iris, aes(x=Petal.Width, y=Petal.Length)) +
     geom_point(aes(color=Species), size=10) + 
     scale_colour_iwanthue(hmax = 90)
     
}

hues documentation built on Dec. 2, 2019, 1:11 a.m.