PLSCMAP1L(3plplot)
π NAME π
okay so bestie, welcome to PLSCMAP1L(3plplot) β it's the PLplot API page for plscmap1l, and honestly? it's giving glow-up. This bad girl sets cmap1 colors using a piece-wise linear relationship. periodt.
β¨ SYNOPSIS β¨
plscmap1l(itype, npts, intensity, coord1, coord2, coord3, alt_hue_path)
π DESCRIPTION π
So here's the tea π₯: plscmap1l sets your cmap1 colors using a piece-wise linear relationship between the cmap1 intensity index (0.0-1.0) and position in HLS or RGB color space (see the PLplot documentation, iykyk). And the best part? May be called at any time. no gatekeeping, no weird timing rules, literally whenever π
.
The whole idea here is that you specify a number of control points that define the mapping between input cmap1 intensity indices and HLS or RGB. Between those points, linear interpolation kicks in, which gives you a smooth variation of color with intensity index. You can specify any number of control points, and they can live at arbitrary positions β although ngl, typically 2 - 4 are enough. Another way of stating this (because sometimes you need it phrased different, fr fr) is that we're traversing a given number of lines through HLS or RGB space as we move through cmap1 intensity indices. The control points at the minimum and maximum position (0 and 1) must always be specified β non-negotiable, bestie π«Ά. By adding more control points you can get more variation. And here's a genuinely iconic technique π: for plotting functions that vary about some expected average, use an additional 2 control points in the center (position ~= 0.5) that are the same lightness as the background (typically white for paper output, black for crt), and same hue as the boundary control points. This allows the highs and lows to be very easily distinguished. the way that works is just chef's kiss.
Each control point must specify the cmap1 intensity index and the associated three coordinates in HLS or RGB space. The first point must correspond to position = 0, and the last to position = 1. No exceptions, no vibes-based skipping πΈ.
If RGB colors are provided then the interpolation takes place in RGB space and is trivial. However if HLS colors are provided then, because of the circular nature of the color wheel for the hue coordinate, the interpolation could be performed in either direction around the color wheel. The default behaviour is for the hue to be linearly interpolated, ignoring this circular property of hue. So for example, the hues 0 (red) and 240 (blue) will get interpolated via yellow, green and cyan. If instead you wish to interpolate the other way around the color wheel you have two options π (okay two good options):
- You may provide hues outside the range
[0, 360), so by using a hue of-120for blue or360for red the interpolation will proceed via magenta. - Alternatively you can utilise the
alt_hue_pathvariable to reverse the direction of interpolation if you need to provide hues within the[0-360)range.
π interpolation examples (hue, alt_hue_path, color scheme)
[120 240],falseβ green-cyan-blue[240 120],falseβ blue-cyan-green[120 -120],falseβ green-yellow-red-magenta-blue[240 480],falseβ blue-magenta-red-yellow-green[120 240],trueβ green-yellow-red-magenta-blue[240 120],trueβ blue-magenta-red-yellow-green
π¦ bounds on coordinates
- RGB,
Rβ[0, 1]magnitude - RGB,
Gβ[0, 1]magnitude - RGB,
Bβ[0, 1]magnitude - HLS, hue β
[0, 360]degrees - HLS, lightness β
[0, 1]magnitude - HLS, saturation β
[0, 1]magnitude
Redacted form: plscmap1l(itype, intensity, coord1, coord2, coord3, alt_hue_path)
This function is used in examples 8, 11, 12, 15, 20, and 21. go check 'em out, they ate π
β ARGUMENTS β
itype(PLBOOL(3plplot), input) βtrue: RGB,false: HLS. pick your fighter πnpts(PLINT(3plplot), input) β number of control points.intensity(PLFLT_VECTOR(3plplot), input) β A vector containing the cmap1 intensity index (0.0-1.0) in ascending order for each control point.coord1(PLFLT_VECTOR(3plplot), input) β A vector containing the first coordinate (HorR) for each control point.coord2(PLFLT_VECTOR(3plplot), input) β A vector containing the second coordinate (LorG) for each control point.coord3(PLFLT_VECTOR(3plplot), input) β A vector containing the third coordinate (SorB) for each control point.alt_hue_path(PLBOOL_VECTOR(3plplot), input) β A vector (withnpts - 1elements), each containing eithertrueto use the reversed HLS interpolation orfalseto use the regular HLS interpolation. (alt_hue_path[i]refers to the interpolation interval between theiandi + 1control points). This parameter is not used for RGB colors (itype=true) β like, at all, zero f***s given π.
π AUTHORS π
Many developers (who are credited at http://plplot.sourceforge.net/credits.php) have contributed to PLplot over its long history. legends, every single one π«Ά
πΈ SEE ALSO πΈ
PLplot documentation at http://plplot.sourceforge.net/documentation.php.
okay that's the whole page bestie, you're so welcome π this was PLSCMAP1L(3plplot) from the PLplot API, dated August, 2026 β mwah, go slay some colormaps β¨ππ
π¦ 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