Skip to content

Interface: Colorbar ​

The colorbar of this colorscale (plan E5.3).

Properties ​

PropertyTypeDefault valueDescription
bgcolor?string"rgba(0,0,0,0)"Background of the box.
bordercolor?string"#444"Border color of the colorbar box.
borderwidth?number0Border width of the box, px. Minimum: 0
dtick?unknownundefinedTick step. Linear axes: a positive number. Log axes: an integer n (a tick every n decades), L<f> (linear steps of f in data units, e.g. L0.5), D1 (every digit) or D2 (1, 2 and 5). Date axes: milliseconds, or M<n> for n months (M12 for years).
exponentformat?"none" | "e" | "E" | "power" | "SI" | "B""B"How large and small numbers are written: none (1000000), e (1e+6), E (1E+6), power (1×10⁶), SI (1M), B (like SI but 1B for 10⁹).
len?number1Length of the colorbar along its axis, padding included (ypad / xpad). Minimum: 0
lenmode?"fraction" | "pixels""fraction"Unit of len: px, or a fraction of the plot height (v) / width (h).
minexponent?number3Smallest decimal exponent written in exponent form (SI/B and exponent formats); smaller magnitudes are written out in full. Minimum: 0
nticks?number0Maximum number of ticks for tickmode: auto (the actual number may be lower so steps stay round). 0 picks it from the axis length. Minimum: 0
orientation?"v" | "h""v"Vertical bar (v, beside the plot) or horizontal bar (h, above or below).
outlinecolor?string"#444"Color of the outline around the bar.
outlinewidth?number1Outline width, px. Minimum: 0
separatethousands?booleanfalseAlways separate thousands (1,000). By default only numbers with 5 or more integer digits are separated.
showexponent?"none" | "all" | "first" | "last""all"Which tick labels show the exponent.
showticklabels?booleantrueShow tick labels.
showtickprefix?"none" | "all" | "first" | "last""all"Which tick labels get tickprefix.
showticksuffix?"none" | "all" | "first" | "last""all"Which tick labels get ticksuffix.
thickness?number30Thickness of the color bar. Minimum: 0
thicknessmode?"fraction" | "pixels""pixels"Unit of thickness: px, or a fraction of the plot width (v) / height (h).
tick0?unknownundefinedPosition of one tick for tickmode: linear (data units; a date on date axes, an exponent on log axes unless dtick is L<f>). Defaults to 0, or 2000-01-01 on date axes.
tickangle?number | "auto""auto"Tick-label rotation in degrees. auto rotates x-axis labels by the first autotickangles entry that avoids overlap.
tickcolor?string"#444"Tick color. Defaults to color.
tickfont?ColorbarTickfontundefinedTick-label font. Defaults to layout.font.
tickformat?string""Tick-label format: a d3-format specifier for numbers (.2f, ~s, $,) or a d3-time-format specifier for dates (%b %Y), plus %{n}f for n digits of fractional seconds and %h for the half year. Empty picks a format automatically.
ticklabeloverflow?"allow" | "hide past div" | "hide past domain"undefinedHide labels past the figure or past the bar. Defaults to hide past domain for inside labels, else hide past div.
ticklabelposition?| "outside" | "inside" | "outside top" | "inside top" | "outside left" | "inside left" | "outside right" | "inside right" | "outside bottom" | "inside bottom""outside"Tick labels outside the bar (away from it) or inside (over it); top/bottom (v) or left/right (h) move them beside their tick.
ticklabelstep?number1Label every n-th tick only (tickmode auto and linear). Minimum: 1
ticklen?number5Tick length in px. Minimum: 0
tickmode?"linear" | "auto" | "array" | "sync"undefinedauto picks up to nticks round ticks; linear places ticks from tick0 every dtick; array uses tickvals/ticktext; sync aligns with the overlaid axis (reserved; behaves as auto). Defaults to array when tickvals is set, linear when dtick is set, else auto.
tickprefix?string""Text before each tick label.
ticks?"" | "outside" | "inside"""Draw tick marks outside or inside the plot area, or not at all ('').
ticksuffix?string""Text after each tick label.
ticktext?DataColumnundefinedTick labels for tickvals. Missing entries are formatted as usual.
tickvals?DataColumnundefinedTick positions for tickmode: array (data units).
tickwidth?number1Tick width in px. Minimum: 0
title?ColorbarTitleundefinedColorbar title.
x?numberundefinedHorizontal position (xref fraction). Defaults to 1.02 (v, paper), 1 (v, container) or 0.5 (h).
xanchor?"left" | "center" | "right"undefinedWhich side of the colorbar sits at x. Defaults to left (v, paper), right (v, container) or center (h).
xpad?number10Horizontal padding, px. Minimum: 0
xref?"container" | "paper""paper"Reference of x: the plot area (paper) or the whole figure.
y?numberundefinedVertical position (yref fraction). Defaults to 0.5 (v), 1.02 (h, paper) or 1 (h, container).
yanchor?"middle" | "top" | "bottom"undefinedWhich side of the colorbar sits at y. Defaults to middle (v), bottom (h, paper) or top (h, container).
ypad?number10Vertical padding, px. Minimum: 0
yref?"container" | "paper""paper"Reference of y: the plot area (paper) or the whole figure.

Released under the MIT License.