One Dimensional Functions

G'MIC has a built in spline-based plotting command, -function1d, which furnishes a basis for ramps of arbitrary character. In isolation, the command generates images only one pixel high, which seems disappointing, until one reaches into the toolkit again and fetches out -expand_y, so we may grow the ramp readily in the transverse direction.
The command's first parameter is a 'stiffness' value, ranging from zero to one. When zero, G'MIC makes no attempt to transition values. When one, the transitions will be continuous to a high degree. The remaining parameter list may be arbitrarily long but divisible by two. These are abscissa (x) ordinate (y) pairs. The abscissa are non-negative and form a strictly ascending sequence, but need not be uniformly spaced. The ordinates may assume zero, positive or negative values of any magnitude. The difference between the first and last abscissa establishes the width of the image; the height is one pixel. -expand_y h/2 sets the desired height, h. Observe the division by two. This curious step arises from -expand_y growing the image from the middle to both ends. From the command's viewpoint, it is expanding out a top and bottom edge.

#First parameter sets smoothness; zero \
#allows sharp transitions, 1 smooths \
#maximally. Remaining parameters are \
#x,y plot pairs. The abscissa (x) need \
#not be uniformly spaced but should \
#form a strictly ascending sequence. \
#The difference between the last and \
#first abscissa set the width of the \
#image.\
gmic -function1d \
 0.3,0,12,43,255,85,127,127,200,170,220,\
213,230,255,100 -expand_y 128 \
 -normalize[-1] 0,255

General Ramps Applying a Curve