Version 6.0 is the start of a new stable release series.
Features introduced in version 6
================================
Work on gnuplot 6 has proceeded in parallel with the incremental updates to
version 5.4 over the past three years. The new version introduces extensions
to the gnuplot command language, support for new output protocols, and
additional plotting styles. Backward compatibility is given high priority
in gnuplot development, so users should find no significant changes required
for techniques or code they are currently using with gnuplot 5.
- Function blocks and scoped variables
- Larger collection of special and complex-valued functions
- New plot styles
o 2D plot stylewith surface
works in 2D polar coordinates to produce a
solid-fill gridded representation of the plane. This is analogous to the
use of dgrid3d and pm3d to produce a 3D gridded surface.
o 2D plot stylewith sectors
renders one annular segment (“sector”) for
each line of input data. This style can generate pie and donut charts,
windrose charts, and a polar equivalent to sparse-matrix heatmaps.
o 2D plot stylewith lines
now has a filter optionsharpen
.
This filter detects spikes in a function plot that would be missed or
under-represented due to coarse sampling. It adds an additional
sampling point at the location of each such peak.
o 3D plot stylewith contourfill
produces 2D or 3D surfaces with
distinct z-ranges indicated by solid color fill. - Hulls, masks, and smoothing
o A cluster of 2D points can be replaced by a bounding polygon (“hull”).
Both convex hulls and concave hulls (χ-shapes) are supported.
o Any hull or other closed path can be used as a mask to display only
selected regions of a pm3d surface or image plot.
o New smoothing option “smooth path” can be used on 2D and 3D curves
that are not monotonic on x or y. This allows smoothing of hulls. - Named palettes
o The current palette can be saved to a named colormap for future us.
o A predefined palette named “viridis” is provided.
o Plots can specify a previously saved palette by name.
This permits the use of multiple palettes in a single plot command.
o Named palettes can be edited to contain an alpha channel. - New built-in functions and array operations
o palette(z) returns the current RGB palette color mapping for z.
o rgbcolor(“name”) returns the 32bit ARGB value for a named color.
o index(Array, element) returns the first index i for which Array[i]
is equal to element.
o split(“string”, “separator”) unpacks the fields in a string into
an array of strings.
o join(array, “separator”) is the complement to split().
It concatenates the elements of a string array into a single string.
ostats <non-existent file>
yields a testable value with no error;
useful to avoid errors or warnings in scripts. - Program control flow
o New syntax if {…} else if {…} else {…}
o XDG base directory conventions for configuration files are supported.
ounset warnings
suppresses output of warning messages to the console.
o Thefit
command is protected by exception handling. Control always
returns to the next line of input even in the case of fit errors.
On return FIT_ERROR is non-zero if an error occurred.
o “Watchpoints” are target values associated with individual plots
in a graph. As that plot is drawn, each component line segment is
monitored to see if its endpoints bracket the target value of a
watchpoint coordinate (x, y, or z) or function f(x,y).
If a match is found, the [x,y] coordinates of the match point are
saved for later use. Possible uses include
- find the intersection points of two curves
- find zeros of a function
- find and notate where a dependent variable or function f(x,y)
crosses a threshold value
- use the mouse to track values along multiple plots simultaneously - New terminals and terminal options
o Terminals that display graphics in the same window as text entry now
support pseudo-mousing; i.e. they respond to arrow keys and other
hot-key bindings during “pause mouse”.
o New terminals kittygd and kittycairo provide in-window graphics for
terminal emulators that support the kitty protocol.
o New terminal webp generates a single frame or an animation sequence
using webp encoding. Frames are generated using pngcairo,
then encoded through the WebPAnimEncoder API.
o New terminal block for text-mode pseudo-graphics uses Unicode block
or Braille characters to offer improved resolution compared to the
dumb or caca terminals.
o latex terminals standalone mode updated to work with texlive2023 - Miscellaneous other new features
o Multiplots can now be saved, replotted, and resized interactively.
This is a change from all previous gnuplot versions, where only the
most recent component of a multiplot could be replotted.
o Time unit settings for major and minor axis tics. For example,
minor tic marks can be placed at exactly one month intervals.
o The character sequence $# in a using specifier evaluates to the total
number of columns available in the current line of data.
“plot FOO using 0:(column($# - 1))” plots the last-but-one field of each row.
o keyword binvalue=avg plots the average, rather than the sum, of binned data.
o “set colorbox bottom” places the color box underneath the plot.
o “set pm3d spotlight” adds a user-controlled spotlight to the lighting model.
o New key layout options to force specific width or number of columns.
Automatic positioning of the key on the page can be manually tweaked
by giving an offset.
o “set isotropic” adjusts the axis scaling in both 2D and 3D plots such
that x, y, and z axes all have the same scale.
o Text rotation angles are not limited to integral degree values.
o Data-driven color assignments in plot style “histograms”.
NOTE: Gnuplot 6.0.0 for Haiku package is available for Haiku R1B4 review. Planned for general use for Haiku R1B5.