Learn R Programming

fishualize (version 0.2.3)

scale_color_fish: fish colour scales

Description

Uses the fish color scale.

Usage

scale_color_fish(
  option = "Centropyge_loricula",
  ...,
  alpha = 1,
  begin = 0,
  end = 1,
  direction = 1,
  discrete = FALSE
)

scale_colour_fish( option = "Centropyge_loricula", ..., alpha = 1, begin = 0, end = 1, direction = 1, discrete = FALSE )

scale_colour_fish_d( option = "Centropyge_loricula", ..., alpha = 1, begin = 0, end = 1, direction = 1 )

scale_color_fish_d( option = "Centropyge_loricula", ..., alpha = 1, begin = 0, end = 1, direction = 1 )

scale_fill_fish_d( option = "Centropyge_loricula", ..., alpha = 1, begin = 0, end = 1, direction = 1 )

scale_fill_fish( option = "Centropyge_loricula", ..., alpha = 1, begin = 0, end = 1, direction = 1, discrete = FALSE )

Arguments

option

A character string indicating the fish species to use.

...

parameters to discrete_scale or scale_fill_gradientn

alpha

pass through parameter to fish

begin

The (corrected) hue in [0,1] at which the fish colormap begins.

end

The (corrected) hue in [0,1] at which the fish colormap ends.

direction

Sets the order of colors in the scale. If 1, the default, colors are as output by fish_pal. If -1, the order of colors is reversed.

discrete

generate a discrete palette? (default: FALSE - generate continuous palette)

Value

Alias of scale_color_fish or scale_fill_fish

Alias of scale_color_fish or scale_fill_fish

Alias of scale_color_fish or scale_fill_fish

Alias of scale_color_fish or scale_fill_fish

Alias of scale_color_fish or scale_fill_fish

Details

For discrete == FALSE (the default) all other arguments are as to scale_fill_gradientn or scale_color_gradientn. Otherwise the function will return a discrete_scale with the plot-computed number of colors.

Examples

Run this code
# NOT RUN {
library(ggplot2)
library(fishualize)


ggplot(diamonds, aes(factor(cut), fill=factor(cut))) +
geom_bar() +
scale_fill_fish(discrete = TRUE, option = "Centropyge_loricula")

ggplot(mtcars, aes(factor(gear), fill=factor(carb))) +
geom_bar() +
scale_fill_fish(discrete = TRUE, option = "Trimma_lantana")

ggplot(mtcars, aes(x = mpg, y = disp, colour = drat)) +
geom_point(size = 4) +
scale_colour_fish(option = "Ostracion_cubicus", direction = -1)




# }

Run the code above in your browser using DataLab