color_bar: Create a Color Bar

View source: R/color_bar.R

color_barR Documentation

Create a Color Bar

Description

Create a Color Bar

Usage

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 Jan. 6, 2023, 7:12 a.m.