PLCOLORBAR(3plplot)
π¨ PLCOLORBAR (3plplot) β the color bar glow-up β¨
okay so bestie, we're in PLplot API land and this one is literally the function that makes your image/shade/gradient plot look like it has its life together π
πΈ NAME πΈ
plcolorbar β plot a color bar for image, shade or gradient plots. that's it, that's the icon.
β¨ SYNOPSIS β¨
plcolorbar(p_colorbar_width, p_colorbar_height, opt, position, x, y,
x_length, y_length, bg_color, bb_color, bb_style, low_cap_color,
high_cap_color, cont_color, cont_width, n_labels, label_opts, labels,
naxes, axis_opts, ticks, sub_ticks, n_values, values)
π DESCRIPTION π
so this routine creates a continuous color bar for image, shade, or gradient plots. (and if you were wondering β yes, pllegend(3plplot) is the sister function for legends with discrete elements, iykyk.) the arguments of plcolorbar give you control over the location and size of the color bar and the location and characteristics of the elements inside it (most of which are optional). the resulting color bar gets clipped at the boundaries of the current subpage β no cap, no cap π§’. (N.B. the adopted coordinate system used for some of the parameters is defined in the documentation of the position parameter, so go read that one, fr fr.)
Redacted form: plcolorbar(p_colorbar_width, p_colorbar_height, opt, position, x, y, x_length, y_length, bg_color, bb_color, bb_style, low_cap_color, high_cap_color, cont_color, cont_width, label_opts, labels, axis_opts, ticks, sub_ticks, values)
This function is used in examples 16 and 33. π«Ά
π ARGUMENTS π
p_colorbar_width(PLFLT_NC_SCALAR(3plplot), output) β the returned value of the labelled and decorated color bar width, in adopted coordinates. she's giving measurements πp_colorbar_height(PLFLT_NC_SCALAR(3plplot), output) β the returned value of the labelled and decorated color bar height, in adopted coordinates.opt(PLINT(3plplot), input) βoptcontains the bits controlling the overall color bar. the orientation (direction of the maximum value) of the color bar is specified withPL_ORIENT_RIGHT,PL_ORIENT_TOP,PL_ORIENT_LEFT, orPL_ORIENT_BOTTOM. if none of these bits are specified, the default orientation is toward the top if the colorbar is placed on the left or right of the viewport, or toward the right if the colorbar is placed on the top or bottom of the viewport. if thePL_COLORBAR_BACKGROUNDbit is set, plot a (semitransparent) background for the color bar β¨. if thePL_COLORBAR_BOUNDING_BOXbit is set, plot a bounding box for the color bar. the type of color bar must be specified with one ofPL_COLORBAR_IMAGE,PL_COLORBAR_SHADE, orPL_COLORBAR_GRADIENTβ and if more than one of those bits is set, only the first one in the above list is honored (sorry bestie, no mixing). the position of the (optional) label/title can be specified withPL_LABEL_RIGHT,PL_LABEL_TOP,PL_LABEL_LEFT, orPL_LABEL_BOTTOM. if no label position bit is set then no label will be drawn. if more than one of this list of bits is specified, only the first one on the list is honored. end-caps for the color bar can be added withPL_COLORBAR_CAP_LOWandPL_COLORBAR_CAP_HIGHβ if a particular color bar cap option is not specified then no cap will be drawn for that end. as a special case forPL_COLORBAR_SHADE, the optionPL_COLORBAR_SHADE_LABELcan be specified: if this option is provided then any tick marks and tick labels will be placed at the breaks between shaded segments. TODO: this should be expanded to support custom placement of tick marks and tick labels at custom value locations for any color bar type. (not me reading the TODO in the manpage π)position(PLINT(3plplot), input) βpositioncontains bits which control the overall position of the color bar and the definition of the adopted coordinates used for positions, just like what is done for thepositionargument forpllegend(3plplot). however, note that the defaults for the position bits (see below) are different than thepllegend(3plplot)case π. the combination of thePL_POSITION_LEFT,PL_POSITION_RIGHT,PL_POSITION_TOP,PL_POSITION_BOTTOM,PL_POSITION_INSIDE, andPL_POSITION_OUTSIDEbits specifies one of the 16 possible standard positions (the 4 corners and centers of the 4 sides, for both the inside and outside cases) of the color bar relative to the adopted coordinate system. the corner positions are specified by the appropriate combination of two of thePL_POSITION_LEFT,PL_POSITION_RIGHT,PL_POSITION_TOP, andPL_POSITION_BOTTOMbits, while the sides are specified by a single value of one of those bits. the adopted coordinates are normalized viewport coordinates if thePL_POSITION_VIEWPORTbit is set, or normalized subpage coordinates if thePL_POSITION_SUBPAGEbit is set. default position bits: if none ofPL_POSITION_LEFT,PL_POSITION_RIGHT,PL_POSITION_TOP, orPL_POSITION_BOTTOMare set, then usePL_POSITION_RIGHT. if neither ofPL_POSITION_INSIDEorPL_POSITION_OUTSIDEis set, usePL_POSITION_OUTSIDE. if neither ofPL_POSITION_VIEWPORTorPL_POSITION_SUBPAGEis set, usePL_POSITION_VIEWPORT.x(PLFLT(3plplot), input) β X offset of the color bar position in adopted coordinates from the specified standard position of the color bar. for positivex, the direction of motion away from the standard position is inward/outward from the standard corner positions or standard left or right positions if thePL_POSITION_INSIDE/PL_POSITION_OUTSIDEbit is set inposition. for the standard top or bottom positions, the direction of motion is toward positive X. π¦y(PLFLT(3plplot), input) β Y offset of the color bar position in adopted coordinates from the specified standard position of the color bar. for positivey, the direction of motion away from the standard position is inward/outward from the standard corner positions or standard top or bottom positions if thePL_POSITION_INSIDE/PL_POSITION_OUTSIDEbit is set inposition. for the standard left or right positions, the direction of motion is toward positive Y.x_length(PLFLT(3plplot), input) β length of the body of the color bar in the X direction, in adopted coordinates.y_length(PLFLT(3plplot), input) β length of the body of the color bar in the Y direction, in adopted coordinates.bg_color(PLINT(3plplot), input) β the cmap0 color of the background for the color bar (PL_COLORBAR_BACKGROUND).bb_color(PLINT(3plplot), input) β the cmap0 color of the bounding-box line for the color bar (PL_COLORBAR_BOUNDING_BOX).bb_style(PLINT(3plplot), input) β thepllsty(3plplot)style number for the bounding-box line for the color bar (PL_COLORBAR_BACKGROUND). (yes, that's what it says β copying it verbatim bestie π)low_cap_color(PLFLT(3plplot), input) β the cmap1 color of the low-end color bar cap, if it is drawn (PL_COLORBAR_CAP_LOW).high_cap_color(PLFLT(3plplot), input) β the cmap1 color of the high-end color bar cap, if it is drawn (PL_COLORBAR_CAP_HIGH).cont_color(PLINT(3plplot), input) β the cmap0 contour color forPL_COLORBAR_SHADEplots. this is passed directly toplshades(3plplot), so it will be interpreted according to the design ofplshades(3plplot).cont_width(PLFLT(3plplot), input) β contour width forPL_COLORBAR_SHADEplots. this is passed directly toplshades(3plplot), so it will be interpreted according to the design ofplshades(3plplot).n_labels(PLINT(3plplot), input) β number of labels to place around the color bar.label_opts(PLINT_VECTOR(3plplot), input) β a vector of options for each ofn_labelslabels.labels(PLCHAR_MATRIX(3plplot), input) β a vector ofn_labelsUTF-8 character strings containing the labels for the color bar. ignored if no label position is specified with one of thePL_COLORBAR_LABEL_RIGHT,PL_COLORBAR_LABEL_TOP,PL_COLORBAR_LABEL_LEFT, orPL_COLORBAR_LABEL_BOTTOMbits in the correspondinglabel_optsfield. π (so don't come crying when your labels don't show, the bits weren't set)n_axes(PLINT(3plplot), input) β number of axis definitions provided. this value must be greater than 0. it is typically 1 (numerical axis labels are provided for one of the long edges of the color bar), but it can be larger if multiple numerical axis labels for the long edges of the color bar are desired. main character energy for the multidimensional girlies β¨axis_opts(PLCHAR_MATRIX(3plplot), input) β a vector ofn_axesascii character strings containing options (interpreted as forplbox(3plplot)) for the color bar's axis definitions.ticks(PLFLT_VECTOR(3plplot), input) β a vector ofn_axesvalues of the spacing of the major tick marks (interpreted as forplbox(3plplot)) for the color bar's axis definitions.sub_ticks(PLINT_VECTOR(3plplot), input) β a vector ofn_axesvalues of the number of subticks (interpreted as forplbox(3plplot)) for the color bar's axis definitions.n_values(PLINT_VECTOR(3plplot), input) β a vector containing the number of elements in each of then_axesrows of thevaluesmatrix.values(PLFLT_MATRIX(3plplot), input) β a matrix containing the numeric values for the data range represented by the color bar. for a row index ofi_axis(where0 < i_axis < n_axes), the number of elements in the row is specified byn_values[i_axis]. forPL_COLORBAR_IMAGEandPL_COLORBAR_GRADIENTthe number of elements is 2, and the corresponding row elements of thevaluesmatrix are the minimum and maximum value represented by the colorbar. forPL_COLORBAR_SHADE, the number and values of the elements of a row of thevaluesmatrix is interpreted the same as thenlevelandclevelarguments ofplshades(3plplot). π
π§ AUTHORS π§
Many developers (who are credited at http://plplot.sourceforge.net/credits.php) have contributed to PLplot over its long history. absolute legends, all of them π
π SEE ALSO π
PLplot documentation at http://plplot.sourceforge.net/documentation.php.
okay that's the whole vibe check, bestie β keep every bit exactly as written, go build that gorgeous color bar, and remember: slay β¨π π¦
source/version: PLplot API, page PLCOLORBAR(3plplot) β dated August, 2026. that's a wrap, ily, bye π«Άπ
π¦ where this page comes from
- ubuntu stonking: plplot-doc 5.15.0+dfsg3-4 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms