color_bar: Create a Color Bar

Description Usage Arguments Details

View source: R/color_bar.R

Description

Create a Color Bar

Usage

1
2
3
4
5
6
7
8
9
color_bar(
  pal,
  min,
  max = -min,
  width = 1,
  nticks = 11,
  ticks = seq(min, max, len = nticks),
  title = ""
)

Arguments

pal

Input color palette

min

Minimum value for colorbar axis

max

Maximum value for colorbar axis

width

Value specifying width of the color bar rectangle - must be between 0 and 10

nticks

Integer specifying number of tick marks to label color bar axis with

ticks

Numeric vector specifying position of tick marks, for instance as produced by seq()

title

Title for the color bar plot

Details

All credit goes to Stackoverflow user John Colby: https://stackoverflow.com/questions/9314658/colorbar-from-custom-colorramppalette


etnite/bwardr documentation built on April 14, 2021, 7:04 p.m.